Skip to content

Commit 9bd5fab

Browse files
authored
Merge pull request #584 from andyzhangx/disable-updatedb
feat: disable updateDB on blobfuse to save account list usage
2 parents dfe2803 + 19a2444 commit 9bd5fab

File tree

6 files changed

+37
-21
lines changed

6 files changed

+37
-21
lines changed

charts/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ The following table lists the configurable parameters of the latest Azure Blob S
129129
| `node.blobfuseProxy.blobfuseVersion` | installed blobfuse version on agent node| `1.4.2` |
130130
| `node.blobfuseProxy.setMaxOpenFileNum` | whether set max open file num on agent node| `true` |
131131
| `node.blobfuseProxy.maxOpenFileNum` | max open file num on agent node| `9000000` |
132-
| `node.blobfuseProxy.removeMlocate` | whether remove `/etc/cron.daily/mlocate` (saving storage account list usage) | `true` |
132+
| `node.blobfuseProxy.disableUpdateDB` | whether disable updateDB on blobfuse (saving storage account list usage) | `true` |
133133
| `node.blobfuseCachePath` | blobfuse cache path(`tmp-path`) | `/mnt` |
134134
| `node.resources.livenessProbe.limits.cpu` | liveness-probe cpu limits | 1 |
135135
| `node.resources.livenessProbe.limits.memory` | liveness-probe memory limits | 100Mi |
113 Bytes
Binary file not shown.

charts/latest/blob-csi-driver/templates/blobfuse-proxy.yaml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apps/v1
33
kind: DaemonSet
44
metadata:
55
name: csi-blobfuse-proxy
6-
namespace: kube-system
6+
namespace: {{ .Release.Namespace }}
77
labels:
88
{{- include "blob.labels" . | nindent 4 }}
99
spec:
@@ -56,7 +56,6 @@ spec:
5656
dpkg -i /tmp/packages-microsoft-prod.deb && apt update && apt-get install -y blobfuse=${BLOBFUSE_VERSION}
5757
fi
5858
dpkg -i /tmp/blobfuse-proxy.deb
59-
rm -f /tmp/packages-microsoft-prod.deb /tmp/blobfuse-proxy.deb
6059
mkdir -p /var/lib/kubelet/plugins/blob.csi.azure.com
6160
systemctl enable blobfuse-proxy
6261
systemctl start blobfuse-proxy
@@ -67,10 +66,16 @@ spec:
6766
sysctl -w fs.file-max=${MAX_FILE_NUM}
6867
fi
6968
70-
REMOVE_MLOCATE=${REMOVE_MLOCATE:-true}
71-
if (( "${REMOVE_MLOCATE}" == "true" ))
69+
updateDBConfigPath="/etc/updatedb.conf"
70+
DISABLE_UPDATEDB=${DISABLE_UPDATEDB:-true}
71+
if (( "${DISABLE_UPDATEDB}" == "true" )) && (( test -f ${updateDBConfigPath} ))
7272
then
73-
rm /etc/cron.daily/mlocate -f
73+
echo "before changing ${updateDBConfigPath}:"
74+
cat ${updateDBConfigPath}
75+
sed -i 's/PRUNEPATHS="\/tmp/PRUNEPATHS="\/mnt \/var\/lib\/kubelet \/tmp/g' ${updateDBConfigPath}
76+
sed -i 's/PRUNEFS="NFS/PRUNEFS="fuse blobfuse NFS/g' ${updateDBConfigPath}
77+
echo "after change:"
78+
cat ${updateDBConfigPath}
7479
fi
7580
7681
# "waiting for blobfuse-proxy service to start"
@@ -95,8 +100,8 @@ spec:
95100
value: "{{ .Values.node.blobfuseProxy.setMaxOpenFileNum }}"
96101
- name: MAX_FILE_NUM
97102
value: "{{ .Values.node.blobfuseProxy.maxOpenFileNum }}"
98-
- name: REMOVE_MLOCATE
99-
value: "{{ .Values.node.blobfuseProxy.removeMlocate }}"
103+
- name: DISABLE_UPDATEDB
104+
value: "{{ .Values.node.blobfuseProxy.disableUpdateDB }}"
100105
resources:
101106
limits:
102107
cpu: 1

charts/latest/blob-csi-driver/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ node:
120120
blobfuseVersion: 1.4.2
121121
setMaxOpenFileNum: true
122122
maxOpenFileNum: "9000000"
123-
removeMlocate: true
123+
disableUpdateDB: true
124124
blobfuseCachePath: /mnt
125125
resources:
126126
livenessProbe:

deploy/blobfuse-proxy.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ spec:
5050
dpkg -i /tmp/packages-microsoft-prod.deb && apt update && apt-get install -y blobfuse=${BLOBFUSE_VERSION}
5151
fi
5252
dpkg -i /tmp/blobfuse-proxy.deb
53-
rm -f /tmp/packages-microsoft-prod.deb /tmp/blobfuse-proxy.deb
5453
mkdir -p /var/lib/kubelet/plugins/blob.csi.azure.com
5554
systemctl enable blobfuse-proxy
5655
systemctl start blobfuse-proxy
@@ -61,10 +60,16 @@ spec:
6160
sysctl -w fs.file-max=${MAX_FILE_NUM}
6261
fi
6362
64-
REMOVE_MLOCATE=${REMOVE_MLOCATE:-true}
65-
if (( "${REMOVE_MLOCATE}" == "true" ))
63+
updateDBConfigPath="/etc/updatedb.conf"
64+
DISABLE_UPDATEDB=${DISABLE_UPDATEDB:-true}
65+
if (( "${DISABLE_UPDATEDB}" == "true" )) && (( test -f ${updateDBConfigPath} ))
6666
then
67-
rm /etc/cron.daily/mlocate -f
67+
echo "before changing ${updateDBConfigPath}:"
68+
cat ${updateDBConfigPath}
69+
sed -i 's/PRUNEPATHS="\/tmp/PRUNEPATHS="\/mnt \/var\/lib\/kubelet \/tmp/g' ${updateDBConfigPath}
70+
sed -i 's/PRUNEFS="NFS/PRUNEFS="fuse blobfuse NFS/g' ${updateDBConfigPath}
71+
echo "after change:"
72+
cat ${updateDBConfigPath}
6873
fi
6974
7075
# "waiting for blobfuse-proxy service to start"
@@ -85,7 +90,7 @@ spec:
8590
value: "true"
8691
- name: MAX_FILE_NUM
8792
value: "9000000"
88-
- name: REMOVE_MLOCATE
93+
- name: DISABLE_UPDATEDB
8994
value: "true"
9095
resources:
9196
limits:

deploy/example/remove-mlocate-ds.yaml renamed to deploy/example/disable-updatedb-ds.yaml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ apiVersion: apps/v1
33
kind: DaemonSet
44
metadata:
55
labels:
6-
component: remove-mlocate
7-
name: remove-mlocate
6+
component: disable-updatedb
7+
name: disable-updatedb
88
namespace: kube-system
99
spec:
1010
selector:
1111
matchLabels:
12-
component: remove-mlocate
12+
component: disable-updatedb
1313
tier: node
1414
template:
1515
metadata:
1616
labels:
17-
component: remove-mlocate
17+
component: disable-updatedb
1818
tier: node
1919
spec:
2020
containers:
@@ -31,11 +31,17 @@ spec:
3131
- sh
3232
- -c
3333
- |
34-
rm /etc/cron.daily/mlocate -f
35-
sleep 600000000s
34+
updateDBConfigPath="/etc/updatedb.conf"
35+
echo "before changing ${updateDBConfigPath}:"
36+
cat ${updateDBConfigPath}
37+
sed -i 's/PRUNEPATHS="\/tmp/PRUNEPATHS="\/mnt \/var\/lib\/kubelet \/tmp/g' ${updateDBConfigPath}
38+
sed -i 's/PRUNEFS="NFS/PRUNEFS="fuse blobfuse NFS/g' ${updateDBConfigPath}
39+
echo "after change:"
40+
cat ${updateDBConfigPath}
41+
sleep 8640000000s
3642
image: alpine
3743
imagePullPolicy: IfNotPresent
38-
name: remove-mlocate
44+
name: disable-updatedb
3945
resources:
4046
requests:
4147
cpu: 10m

0 commit comments

Comments
 (0)