Skip to content

Commit 50b4c9b

Browse files
committed
fix: support blobfuse2 install for GKE cos node
1 parent ba91001 commit 50b4c9b

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

pkg/blobfuse-proxy/init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ echo "Linux distribution: $DISTRIBUTION, Arch: $ARCH"
3939

4040
# install blobfuse-proxy and blobfuse/blofuse2 if needed
4141
case "${DISTRIBUTION}" in
42-
"rhcos")
42+
"rhcos" | "cos")
4343
. ./blobfuse-proxy/install-proxy-rhcos.sh
4444
;;
4545
*)

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

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,16 @@
1616

1717
set -xe
1818

19-
# in coreos, we could just copy the blobfuse2 binary to /usr/local/bin/blobfuse2
19+
BIN_PATH=${BIN_PATH:-/usr/local/bin}
20+
if [ "${DISTRIBUTION}" = "cos" ]; then
21+
BIN_PATH="/home/kubernetes/bin"
22+
fi
23+
#copy blobfuse2 binary to BIN_PATH/blobfuse2
2024
updateBlobfuse2="true"
2125
if [ "${INSTALL_BLOBFUSE}" = "true" ] || [ "${INSTALL_BLOBFUSE2}" = "true" ]
2226
then
23-
if [ -f "/host/usr/local/bin/blobfuse2" ];then
24-
old=$(sha256sum /host/usr/local/bin/blobfuse2 | awk '{print $1}')
27+
if [ -f "/host/${BIN_PATH}/blobfuse2" ];then
28+
old=$(sha256sum /host/${BIN_PATH}/blobfuse2 | awk '{print $1}')
2529
new=$(sha256sum /usr/bin/blobfuse2 | awk '{print $1}')
2630
if [ "$old" = "$new" ];then
2731
updateBlobfuse2="false"
@@ -34,15 +38,15 @@ else
3438
fi
3539
if [ "$updateBlobfuse2" = "true" ];then
3640
echo "copy blobfuse2...."
37-
cp /usr/bin/blobfuse2 /host/usr/local/bin/blobfuse2 --force
38-
chmod 755 /host/usr/local/bin/blobfuse2
41+
cp /usr/bin/blobfuse2 /host/${BIN_PATH}/blobfuse2 --force
42+
chmod 755 /host/${BIN_PATH}/blobfuse2
3943
fi
4044

4145
if [ "${INSTALL_BLOBFUSE_PROXY}" = "true" ];then
4246
# install blobfuse-proxy
4347
updateBlobfuseProxy="true"
44-
if [ -f "/host/usr/local/bin/blobfuse-proxy" ];then
45-
old=$(sha256sum /host/usr/local/bin/blobfuse-proxy | awk '{print $1}')
48+
if [ -f "/host/${BIN_PATH}/blobfuse-proxy" ];then
49+
old=$(sha256sum /host/${BIN_PATH}/blobfuse-proxy | awk '{print $1}')
4650
new=$(sha256sum /blobfuse-proxy/blobfuse-proxy | awk '{print $1}')
4751
if [ "$old" = "$new" ];then
4852
updateBlobfuseProxy="false"
@@ -51,14 +55,14 @@ if [ "${INSTALL_BLOBFUSE_PROXY}" = "true" ];then
5155
fi
5256
if [ "$updateBlobfuseProxy" = "true" ];then
5357
echo "copy blobfuse-proxy...."
54-
rm -rf /host/"$KUBELET_PATH"/plugins/blob.csi.azure.com/blobfuse-proxy.sock
55-
cp /blobfuse-proxy/blobfuse-proxy /host/usr/local/bin/blobfuse-proxy --force
56-
chmod 755 /host/usr/local/bin/blobfuse-proxy
58+
rm -rf /host/${KUBELET_PATH}/plugins/blob.csi.azure.com/blobfuse-proxy.sock
59+
cp /blobfuse-proxy/blobfuse-proxy /host/${BIN_PATH}/blobfuse-proxy --force
60+
chmod 755 /host/${BIN_PATH}/blobfuse-proxy
5761
fi
5862

5963
updateService="true"
60-
echo "change from /usr/bin/blobfuse-proxy to /usr/local/bin/blobfuse-proxy in blobfuse-proxy.service"
61-
sed -i 's/\/usr\/bin\/blobfuse-proxy/\/usr\/local\/bin\/blobfuse-proxy/g' /blobfuse-proxy/blobfuse-proxy.service
64+
echo "change from /usr/bin/blobfuse-proxy to ${BIN_PATH}/blobfuse-proxy in blobfuse-proxy.service"
65+
sed -i "s/\/usr\/bin\/blobfuse-proxy/${BIN_PATH}\/blobfuse-proxy/g" /blobfuse-proxy/blobfuse-proxy.service
6266
if [ -f "/host/etc/systemd/system/blobfuse-proxy.service" ];then
6367
old=$(sha256sum /host/etc/systemd/system/blobfuse-proxy.service | awk '{print $1}')
6468
new=$(sha256sum /blobfuse-proxy/blobfuse-proxy.service | awk '{print $1}')

pkg/blobfuse-proxy/install-proxy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ if [ "${INSTALL_BLOBFUSE_PROXY}" = "true" ];then
100100
fi
101101
if [ "$updateBlobfuseProxy" = "true" ];then
102102
echo "copy blobfuse-proxy...."
103-
rm -rf /host/"$KUBELET_PATH"/plugins/blob.csi.azure.com/blobfuse-proxy.sock
103+
rm -rf /host/${KUBELET_PATH}/plugins/blob.csi.azure.com/blobfuse-proxy.sock
104104
cp /blobfuse-proxy/blobfuse-proxy /host/usr/bin/blobfuse-proxy --force
105105
chmod 755 /host/usr/bin/blobfuse-proxy
106106
fi

0 commit comments

Comments
 (0)