From 745da3fc8d5bd1f96b0b18ac48a008e62674c148 Mon Sep 17 00:00:00 2001 From: andyzhangx Date: Sat, 9 Aug 2025 14:48:31 +0000 Subject: [PATCH 1/3] fix: support blobfuse2 install for GKE cos node fix --- pkg/blobfuse-proxy/init.sh | 2 +- pkg/blobfuse-proxy/install-proxy-rhcos.sh | 28 +++++++++++++---------- pkg/blobfuse-proxy/install-proxy.sh | 2 +- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/pkg/blobfuse-proxy/init.sh b/pkg/blobfuse-proxy/init.sh index 7beaa13dc..a1d8c3a97 100755 --- a/pkg/blobfuse-proxy/init.sh +++ b/pkg/blobfuse-proxy/init.sh @@ -39,7 +39,7 @@ echo "Linux distribution: $DISTRIBUTION, Arch: $ARCH" # install blobfuse-proxy and blobfuse/blofuse2 if needed case "${DISTRIBUTION}" in - "rhcos") + "rhcos" | "cos") . ./blobfuse-proxy/install-proxy-rhcos.sh ;; *) diff --git a/pkg/blobfuse-proxy/install-proxy-rhcos.sh b/pkg/blobfuse-proxy/install-proxy-rhcos.sh index e15ae011a..522160a02 100644 --- a/pkg/blobfuse-proxy/install-proxy-rhcos.sh +++ b/pkg/blobfuse-proxy/install-proxy-rhcos.sh @@ -16,12 +16,16 @@ set -xe -# in coreos, we could just copy the blobfuse2 binary to /usr/local/bin/blobfuse2 +BIN_PATH=${BIN_PATH:-/usr/local/bin} +if [ "${DISTRIBUTION}" = "cos" ]; then + BIN_PATH="/home/kubernetes/bin" +fi +#copy blobfuse2 binary to BIN_PATH/blobfuse2 updateBlobfuse2="true" if [ "${INSTALL_BLOBFUSE}" = "true" ] || [ "${INSTALL_BLOBFUSE2}" = "true" ] then - if [ -f "/host/usr/local/bin/blobfuse2" ];then - old=$(sha256sum /host/usr/local/bin/blobfuse2 | awk '{print $1}') + if [ -f "/host/${BIN_PATH}/blobfuse2" ];then + old=$(sha256sum /host/${BIN_PATH}/blobfuse2 | awk '{print $1}') new=$(sha256sum /usr/bin/blobfuse2 | awk '{print $1}') if [ "$old" = "$new" ];then updateBlobfuse2="false" @@ -34,15 +38,15 @@ else fi if [ "$updateBlobfuse2" = "true" ];then echo "copy blobfuse2...." - cp /usr/bin/blobfuse2 /host/usr/local/bin/blobfuse2 --force - chmod 755 /host/usr/local/bin/blobfuse2 + cp /usr/bin/blobfuse2 /host/${BIN_PATH}/blobfuse2 --force + chmod 755 /host/${BIN_PATH}/blobfuse2 fi if [ "${INSTALL_BLOBFUSE_PROXY}" = "true" ];then # install blobfuse-proxy updateBlobfuseProxy="true" - if [ -f "/host/usr/local/bin/blobfuse-proxy" ];then - old=$(sha256sum /host/usr/local/bin/blobfuse-proxy | awk '{print $1}') + if [ -f "/host/${BIN_PATH}/blobfuse-proxy" ];then + old=$(sha256sum /host/${BIN_PATH}/blobfuse-proxy | awk '{print $1}') new=$(sha256sum /blobfuse-proxy/blobfuse-proxy | awk '{print $1}') if [ "$old" = "$new" ];then updateBlobfuseProxy="false" @@ -51,14 +55,14 @@ if [ "${INSTALL_BLOBFUSE_PROXY}" = "true" ];then fi if [ "$updateBlobfuseProxy" = "true" ];then echo "copy blobfuse-proxy...." - rm -rf /host/"$KUBELET_PATH"/plugins/blob.csi.azure.com/blobfuse-proxy.sock - cp /blobfuse-proxy/blobfuse-proxy /host/usr/local/bin/blobfuse-proxy --force - chmod 755 /host/usr/local/bin/blobfuse-proxy + rm -rf /host/${KUBELET_PATH}/plugins/blob.csi.azure.com/blobfuse-proxy.sock + cp /blobfuse-proxy/blobfuse-proxy /host/${BIN_PATH}/blobfuse-proxy --force + chmod 755 /host/${BIN_PATH}/blobfuse-proxy fi updateService="true" - echo "change from /usr/bin/blobfuse-proxy to /usr/local/bin/blobfuse-proxy in blobfuse-proxy.service" - sed -i 's/\/usr\/bin\/blobfuse-proxy/\/usr\/local\/bin\/blobfuse-proxy/g' /blobfuse-proxy/blobfuse-proxy.service + echo "change from /usr/bin/blobfuse-proxy to ${BIN_PATH}/blobfuse-proxy in blobfuse-proxy.service" + sed -i "s|/usr/bin/blobfuse-proxy|${BIN_PATH}/blobfuse-proxy|g" /blobfuse-proxy/blobfuse-proxy.service if [ -f "/host/etc/systemd/system/blobfuse-proxy.service" ];then old=$(sha256sum /host/etc/systemd/system/blobfuse-proxy.service | awk '{print $1}') new=$(sha256sum /blobfuse-proxy/blobfuse-proxy.service | awk '{print $1}') diff --git a/pkg/blobfuse-proxy/install-proxy.sh b/pkg/blobfuse-proxy/install-proxy.sh index e564d679f..a0197a866 100644 --- a/pkg/blobfuse-proxy/install-proxy.sh +++ b/pkg/blobfuse-proxy/install-proxy.sh @@ -100,7 +100,7 @@ if [ "${INSTALL_BLOBFUSE_PROXY}" = "true" ];then fi if [ "$updateBlobfuseProxy" = "true" ];then echo "copy blobfuse-proxy...." - rm -rf /host/"$KUBELET_PATH"/plugins/blob.csi.azure.com/blobfuse-proxy.sock + rm -rf /host/${KUBELET_PATH}/plugins/blob.csi.azure.com/blobfuse-proxy.sock cp /blobfuse-proxy/blobfuse-proxy /host/usr/bin/blobfuse-proxy --force chmod 755 /host/usr/bin/blobfuse-proxy fi From 29d2885269e6ef8415ffbad9620c119a5a1ea96f Mon Sep 17 00:00:00 2001 From: andyzhangx Date: Sun, 10 Aug 2025 02:34:30 +0000 Subject: [PATCH 2/3] test: disable migrateK8sRepo --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e0d459d0f..4142f8e27 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ CSI_IMAGE_TAG ?= $(REGISTRY)/$(IMAGE_NAME):$(IMAGE_VERSION) CSI_IMAGE_TAG_LATEST = $(REGISTRY)/$(IMAGE_NAME):latest BUILD_DATE ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ") LDFLAGS ?= "-X ${PKG}/pkg/blob.driverVersion=${IMAGE_VERSION} -X ${PKG}/pkg/blob.gitCommit=${GIT_COMMIT} -X ${PKG}/pkg/blob.buildDate=${BUILD_DATE} -s -w -extldflags '-static'" -E2E_HELM_OPTIONS ?= --set image.blob.pullPolicy=Always --set image.blob.repository=$(REGISTRY)/$(IMAGE_NAME) --set image.blob.tag=$(IMAGE_VERSION) --set driver.userAgentSuffix="e2e-test" --set node.blobfuseProxy.migrateK8sRepo=true --set controller.runOnControlPlane=true +E2E_HELM_OPTIONS ?= --set image.blob.pullPolicy=Always --set image.blob.repository=$(REGISTRY)/$(IMAGE_NAME) --set image.blob.tag=$(IMAGE_VERSION) --set driver.userAgentSuffix="e2e-test" --set controller.runOnControlPlane=true ifdef ENABLE_BLOBFUSE_PROXY E2E_HELM_OPTIONS += --set node.enableBlobfuseProxy=true --set image.blob.pullPolicy=Always --set controller.logLevel=6 --set node.logLevel=6 endif From b31ff9ffee4677efb09a56b458dc08e9e7fd3e18 Mon Sep 17 00:00:00 2001 From: andyzhangx Date: Sun, 17 Aug 2025 08:21:33 +0000 Subject: [PATCH 3/3] fix: support gardenlinux node --- pkg/blobfuse-proxy/init.sh | 2 +- pkg/blobfuse-proxy/install-proxy-rhcos.sh | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/pkg/blobfuse-proxy/init.sh b/pkg/blobfuse-proxy/init.sh index a1d8c3a97..e41da2bdb 100755 --- a/pkg/blobfuse-proxy/init.sh +++ b/pkg/blobfuse-proxy/init.sh @@ -39,7 +39,7 @@ echo "Linux distribution: $DISTRIBUTION, Arch: $ARCH" # install blobfuse-proxy and blobfuse/blofuse2 if needed case "${DISTRIBUTION}" in - "rhcos" | "cos") + "rhcos" | "cos" | "gardenlinux") . ./blobfuse-proxy/install-proxy-rhcos.sh ;; *) diff --git a/pkg/blobfuse-proxy/install-proxy-rhcos.sh b/pkg/blobfuse-proxy/install-proxy-rhcos.sh index 522160a02..29f8c8d84 100644 --- a/pkg/blobfuse-proxy/install-proxy-rhcos.sh +++ b/pkg/blobfuse-proxy/install-proxy-rhcos.sh @@ -18,8 +18,18 @@ set -xe BIN_PATH=${BIN_PATH:-/usr/local/bin} if [ "${DISTRIBUTION}" = "cos" ]; then + echo "set BIN_PATH to /home/kubernetes/bin" BIN_PATH="/home/kubernetes/bin" fi +if [ "${DISTRIBUTION}" = "gardenlinux" ]; then + echo "set BIN_PATH to /var/bin" + BIN_PATH="/var/bin" +fi +if [ "${CUSTOM_BIN_PATH}" != "" ]; then + echo "set BIN_PATH to ${CUSTOM_BIN_PATH}" + BIN_PATH="${CUSTOM_BIN_PATH}" +fi + #copy blobfuse2 binary to BIN_PATH/blobfuse2 updateBlobfuse2="true" if [ "${INSTALL_BLOBFUSE}" = "true" ] || [ "${INSTALL_BLOBFUSE2}" = "true" ] @@ -63,6 +73,10 @@ if [ "${INSTALL_BLOBFUSE_PROXY}" = "true" ];then updateService="true" echo "change from /usr/bin/blobfuse-proxy to ${BIN_PATH}/blobfuse-proxy in blobfuse-proxy.service" sed -i "s|/usr/bin/blobfuse-proxy|${BIN_PATH}/blobfuse-proxy|g" /blobfuse-proxy/blobfuse-proxy.service + if [ "${BIN_PATH}" != "/usr/local/bin" ]; then + echo "add Environment=\"PATH=${BIN_PATH}:$PATH\" in blobfuse-proxy.service" + sed -i "/Delegate=yes/a Environment=\"PATH=${BIN_PATH}:\$PATH\"" /blobfuse-proxy/blobfuse-proxy.service + fi if [ -f "/host/etc/systemd/system/blobfuse-proxy.service" ];then old=$(sha256sum /host/etc/systemd/system/blobfuse-proxy.service | awk '{print $1}') new=$(sha256sum /blobfuse-proxy/blobfuse-proxy.service | awk '{print $1}')