Skip to content

Commit 3a4ed74

Browse files
authored
Merge pull request #1342 from cvvz/release-1.24-1325
[release-1.24] feat: support setting kubelet path for blobfuse-proxy endpoint
2 parents 972f703 + 62e5f48 commit 3a4ed74

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

charts/latest/blob-csi-driver/templates/csi-blob-node.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ spec:
9797
value: "{{ .Values.node.blobfuseProxy.maxOpenFileNum }}"
9898
- name: DISABLE_UPDATEDB
9999
value: "{{ .Values.node.blobfuseProxy.disableUpdateDB }}"
100+
- name: KUBELET_PATH
101+
value: "{{ .Values.linux.kubelet }}"
100102
volumeMounts:
101103
- name: host-usr
102104
mountPath: /host/usr

pkg/blobfuse-proxy/init.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ DISABLE_UPDATEDB=${DISABLE_UPDATEDB:-true}
2121
SET_MAX_OPEN_FILE_NUM=${SET_MAX_OPEN_FILE_NUM:-true}
2222
SET_READ_AHEAD_SIZE=${SET_READ_AHEAD_SIZE:-true}
2323
READ_AHEAD_KB=${READ_AHEAD_KB:-15380}
24+
KUBELET_PATH=${KUBELET_PATH:-/var/lib/kubelet}
25+
if [ "$KUBELET_PATH" != "/var/lib/kubelet" ];then
26+
echo "kubelet path is $KUBELET_PATH, update blobfuse-proxy.service...."
27+
sed -i "s#--blobfuse-proxy-endpoint[^ ]*#--blobfuse-proxy-endpoint=unix:/${KUBELET_PATH}/plugins/blob.csi.azure.com/blobfuse-proxy.sock#" /blobfuse-proxy/blobfuse-proxy.service
28+
echo "blobfuse-proxy endpoint is updated to unix:/$KUBELET_PATH/plugins/blob.csi.azure.com/blobfuse-proxy.sock"
29+
fi
2430

2531
HOST_CMD="nsenter --mount=/proc/1/ns/mnt"
2632

pkg/blobfuse-proxy/install-proxy-rhcos.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ if [ -f "/host/usr/local/bin/blobfuse-proxy" ];then
3535
fi
3636
if [ "$updateBlobfuseProxy" = "true" ];then
3737
echo "copy blobfuse-proxy...."
38-
rm -rf /host/var/lib/kubelet/plugins/blob.csi.azure.com/blobfuse-proxy.sock
38+
rm -rf /host/"$KUBELET_PATH"/plugins/blob.csi.azure.com/blobfuse-proxy.sock
3939
rm -rf /host/usr/local/bin/blobfuse-proxy
4040
cp /blobfuse-proxy/blobfuse-proxy /host/usr/local/bin/blobfuse-proxy
4141
chmod 755 /host/usr/local/bin/blobfuse-proxy

pkg/blobfuse-proxy/install-proxy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ if [ -f "/host/usr/bin/blobfuse-proxy" ];then
8989
fi
9090
if [ "$updateBlobfuseProxy" = "true" ];then
9191
echo "copy blobfuse-proxy...."
92-
rm -rf /host/var/lib/kubelet/plugins/blob.csi.azure.com/blobfuse-proxy.sock
92+
rm -rf /host/"$KUBELET_PATH"/plugins/blob.csi.azure.com/blobfuse-proxy.sock
9393
rm -rf /host/usr/bin/blobfuse-proxy
9494
cp /blobfuse-proxy/blobfuse-proxy /host/usr/bin/blobfuse-proxy
9595
chmod 755 /host/usr/bin/blobfuse-proxy

0 commit comments

Comments
 (0)