diff --git a/README.md b/README.md index ddf64ee6c..ace5239de 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,11 @@ This option does not depend on cloud provider config file, supports cross subscr > If you want to install a lower version of blobfuse2 than the current version, you can add ` --allow-downgrades` to the `BLOBFUSE2_VERSION` value, e.g. > ```console > kubectl patch daemonset csi-blob-node -n kube-system -p '{"spec":{"template":{"spec":{"initContainers":[{"env":[{"name":"INSTALL_BLOBFUSE2","value":"true"},{"name":"BLOBFUSE2_VERSION","value":"2.3.0 --allow-downgrades"}],"name":"install-blobfuse-proxy"}]}}}}' +> ``` +> +> Alternatively, when using Helm charts, you can use the dedicated `allowBlobfuse2Downgrades` parameter for cleaner configuration: +> ```console +> helm upgrade --set node.blobfuseProxy.blobfuse2Version="2.3.0" --set node.blobfuseProxy.allowBlobfuse2Downgrades=true blob-csi-driver charts/latest/blob-csi-driver > ``` - install by [helm charts](./charts) diff --git a/charts/latest/blob-csi-driver/templates/csi-blob-node.yaml b/charts/latest/blob-csi-driver/templates/csi-blob-node.yaml index 2cb7d47d0..3058e33d7 100644 --- a/charts/latest/blob-csi-driver/templates/csi-blob-node.yaml +++ b/charts/latest/blob-csi-driver/templates/csi-blob-node.yaml @@ -92,6 +92,8 @@ spec: value: "{{ .Values.node.blobfuseProxy.installBlobfuse2 }}" - name: BLOBFUSE2_VERSION value: "{{ .Values.node.blobfuseProxy.blobfuse2Version }}" + - name: ALLOW_BLOBFUSE2_DOWNGRADES + value: "{{ .Values.node.blobfuseProxy.allowBlobfuse2Downgrades }}" - name: INSTALL_BLOBFUSE_PROXY value: "{{ .Values.node.enableBlobfuseProxy }}" - name: SET_MAX_OPEN_FILE_NUM diff --git a/charts/latest/blob-csi-driver/values.yaml b/charts/latest/blob-csi-driver/values.yaml index bcbbd047c..797208b9b 100644 --- a/charts/latest/blob-csi-driver/values.yaml +++ b/charts/latest/blob-csi-driver/values.yaml @@ -124,6 +124,7 @@ node: blobfuseVersion: "1.4.5" installBlobfuse2: true blobfuse2Version: "2.4.1" + allowBlobfuse2Downgrades: false setMaxOpenFileNum: true maxOpenFileNum: "9000000" disableUpdateDB: true diff --git a/pkg/blobfuse-proxy/install-proxy.sh b/pkg/blobfuse-proxy/install-proxy.sh index c4a4df741..09e851f66 100644 --- a/pkg/blobfuse-proxy/install-proxy.sh +++ b/pkg/blobfuse-proxy/install-proxy.sh @@ -73,7 +73,11 @@ then echo "install blobfuse2 with latest version" pkg_list="${pkg_list} blobfuse2" else - pkg_list="${pkg_list} blobfuse2=${BLOBFUSE2_VERSION}" + blobfuse2_install_str="blobfuse2=${BLOBFUSE2_VERSION}" + if [ "${ALLOW_BLOBFUSE2_DOWNGRADES}" = "true" ]; then + blobfuse2_install_str="${blobfuse2_install_str} --allow-downgrades" + fi + pkg_list="${pkg_list} ${blobfuse2_install_str}" fi fi