Skip to content

Commit 27a9e4d

Browse files
committed
feat: support install specific blobfuse version using blobfuse-proxy
1 parent 5bdf2d1 commit 27a9e4d

File tree

7 files changed

+68
-20
lines changed

7 files changed

+68
-20
lines changed

charts/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,10 @@ The following table lists the configurable parameters of the latest Azure Blob S
124124
| `node.logLevel` | node driver log level | `5` |
125125
| `node.mountPermissions` | mounted folder permissions (only applies for NFS) | `0777`
126126
| `node.enableBlobfuseProxy` | enable blobfuse-proxy on agent node | `false` |
127-
| `node.blobfuseProxy.installBlobfuse` | whether install blobfuse on agent node| `true` |
128-
| `node.blobfuseProxy.blobfuseVersion` | installed blobfuse version on agent node| `1.4.2` |
127+
| `node.blobfuseProxy.installBlobfuse` | whether blobfuse should be installed on agent node| `true` |
128+
| `node.blobfuseProxy.blobfuseVersion` | installed blobfuse version on agent node (if the value is empty, it means that the latest version should be installed.) | `` |
129+
| `node.blobfuseProxy.installBlobfuse2` | whether blobfuse2 should be installed on agent node| `true` |
130+
| `node.blobfuseProxy.blobfuse2Version` | installed blobfuse2 version on agent node (if the value is empty, it means that the latest version should be installed.) | ``
129131
| `node.blobfuseProxy.setMaxOpenFileNum` | whether set max open file num on agent node| `true` |
130132
| `node.blobfuseProxy.maxOpenFileNum` | max open file num on agent node| `9000000` |
131133
| `node.blobfuseProxy.disableUpdateDB` | whether disable updateDB on blobfuse (saving storage account list usage) | `true` |
20 Bytes
Binary file not shown.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ spec:
8080
value: "{{ .Values.node.blobfuseProxy.installBlobfuse }}"
8181
- name: BLOBFUSE_VERSION
8282
value: "{{ .Values.node.blobfuseProxy.blobfuseVersion }}"
83+
- name: INSTALL_BLOBFUSE2
84+
value: "{{ .Values.node.blobfuseProxy.installBlobfuse2 }}"
85+
- name: BLOBFUSE2_VERSION
86+
value: "{{ .Values.node.blobfuseProxy.blobfuse2Version }}"
8387
- name: SET_MAX_OPEN_FILE_NUM
8488
value: "{{ .Values.node.blobfuseProxy.setMaxOpenFileNum }}"
8589
- name: MAX_FILE_NUM

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ node:
118118
enableBlobfuseProxy: false
119119
blobfuseProxy:
120120
installBlobfuse: true
121-
blobfuseVersion: 1.4.5
121+
blobfuseVersion: ""
122+
installBlobfuse2: true
123+
blobfuse2Version: ""
122124
setMaxOpenFileNum: true
123125
maxOpenFileNum: "9000000"
124126
disableUpdateDB: true

deploy/csi-blob-node.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,16 @@ spec:
4646
env:
4747
- name: DEBIAN_FRONTEND
4848
value: "noninteractive"
49-
- name: INSTALL_BLOBFUSE
50-
value: "true"
5149
- name: INSTALL_BLOBFUSE_PROXY
5250
value: "true"
51+
- name: INSTALL_BLOBFUSE
52+
value: "true"
5353
- name: BLOBFUSE_VERSION
54-
value: 1.4.5
54+
value: ""
55+
- name: INSTALL_BLOBFUSE2
56+
value: "true"
57+
- name: BLOBFUSE2_VERSION
58+
value: ""
5559
- name: SET_MAX_OPEN_FILE_NUM
5660
value: "true"
5761
- name: MAX_FILE_NUM

pkg/blobfuse-proxy/init.sh

100644100755
Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,54 @@
1717
set -xe
1818

1919
INSTALL_BLOBFUSE_PROXY=${INSTALL_BLOBFUSE_PROXY:-true}
20-
INSTALL_BLOBFUSE=${INSTALL_BLOBFUSE:-true}
2120
DISABLE_UPDATEDB=${DISABLE_UPDATEDB:-true}
2221
SET_MAX_OPEN_FILE_NUM=${SET_MAX_OPEN_FILE_NUM:-true}
2322
SET_READ_AHEAD_SIZE=${SET_READ_AHEAD_SIZE:-true}
2423
READ_AHEAD_KB=${READ_AHEAD_KB:-15380}
2524

2625
HOST_CMD="nsenter --mount=/proc/1/ns/mnt"
2726

28-
# install/update blobfuse
29-
if [ "${INSTALL_BLOBFUSE}" = "true" ]
27+
if [ "${INSTALL_BLOBFUSE}" = "true" ] || [ "${INSTALL_BLOBFUSE2}" = "true" ]
3028
then
3129
cp /blobfuse-proxy/packages-microsoft-prod.deb /host/etc/
32-
yes | $HOST_CMD dpkg -i /etc/packages-microsoft-prod.deb && \
33-
$HOST_CMD apt update && \
34-
$HOST_CMD apt-get install -y fuse blobfuse2 blobfuse="${BLOBFUSE_VERSION}" && \
30+
# when running dpkg -i /etc/packages-microsoft-prod.deb, need to enter y to continue.
31+
# refer to https://stackoverflow.com/questions/45349571/how-to-install-deb-with-dpkg-non-interactively
32+
yes | $HOST_CMD dpkg -i /etc/packages-microsoft-prod.deb && $HOST_CMD apt update
33+
34+
pkg_list=""
35+
if [ "${INSTALL_BLOBFUSE}" = "true" ]
36+
then
37+
pkg_list="${pkg_list} fuse"
38+
# install blobfuse with latest version or specific version
39+
if [ -z "${BLOBFUSE_VERSION}" ]; then
40+
echo "install blobfuse with latest version"
41+
pkg_list="${pkg_list} blobfuse"
42+
else
43+
pkg_list="${pkg_list} blobfuse=${BLOBFUSE_VERSION}"
44+
fi
45+
fi
46+
47+
if [ "${INSTALL_BLOBFUSE2}" = "true" ]
48+
then
49+
release=$($HOST_CMD lsb_release -rs)
50+
if [ "$release" = "18.04" ]; then
51+
echo "install fuse for blobfuse2"
52+
pkg_list="${pkg_list} fuse"
53+
else
54+
echo "install fuse3 for blobfuse2, current release is $release"
55+
pkg_list="${pkg_list} fuse3"
56+
fi
57+
58+
# install blobfuse2 with latest version or specific version
59+
if [ -z "${BLOBFUSE2_VERSION}" ]; then
60+
echo "install blobfuse2 with latest version"
61+
pkg_list="${pkg_list} blobfuse2"
62+
else
63+
pkg_list="${pkg_list} blobfuse2=${BLOBFUSE2_VERSION}"
64+
fi
65+
fi
66+
echo "begin to install ${pkg_list}"
67+
$HOST_CMD apt-get install -y $pkg_list
3568
$HOST_CMD rm -f /etc/packages-microsoft-prod.deb
3669
fi
3770

@@ -102,4 +135,4 @@ then
102135
SUBSYSTEM=="bdi", ACTION=="add", PROGRAM="$AWK_PATH -v bdi=\$kernel 'BEGIN{ret=1} {if (\$4 == bdi){ret=0}} END{exit ret}' /proc/fs/nfsfs/volumes", ATTR{read_ahead_kb}="$READ_AHEAD_KB"
103136
EOF
104137
$HOST_CMD udevadm control --reload
105-
fi
138+
fi

test/utils/blob_log.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,14 @@ echo "==========================================================================
5454
ip=`kubectl get svc csi-$DRIVER-controller -n kube-system | awk '{print $4}'`
5555
curl http://$ip:29634/metrics
5656

57+
if [ -n "$ENABLE_BLOBFUSE_PROXY" ]; then
58+
echo "print out install-blobfuse-proxy logs ..."
59+
echo "======================================================================================"
60+
LABEL="app=csi-$DRIVER-node"
61+
PROXY=install-blobfuse-proxy
62+
kubectl get pods -n${NS} -l${LABEL} \
63+
| awk 'NR>1 {print $1}' \
64+
| xargs -I {} kubectl logs {} --prefix -c${PROXY} -n${NS}
65+
fi
66+
5767

58-
echo "print out sysctl-install-blobfuseproxy logs ..."
59-
echo "======================================================================================"
60-
LABEL='app=csi-blobfuse-proxy'
61-
PROXY=sysctl-install-blobfuse-proxy
62-
kubectl get pods -n${NS} -l${LABEL} \
63-
| awk 'NR>1 {print $1}' \
64-
| xargs -I {} kubectl logs {} --prefix -c${PROXY} -n${NS}

0 commit comments

Comments
 (0)