Skip to content

Commit 121070f

Browse files
authored
Merge pull request #2213 from flatcar-hub/t-lo/release-1.27-pick-flatcar-support
[release 1.27] 🌈 Feature: Add support for Flatcar Container Linux
2 parents 592d33b + 1aa7626 commit 121070f

File tree

5 files changed

+32
-17
lines changed

5 files changed

+32
-17
lines changed
13 Bytes
Binary file not shown.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ spec:
111111
- name: host-home-kubernetes-bin
112112
mountPath: /host/home/kubernetes/bin
113113
{{- end }}
114-
{{- if eq .Values.linux.distro "gardenlinux" }}
114+
{{- if or (eq .Values.linux.distro "gardenlinux") (eq .Values.linux.distro "flatcar") }}
115115
- name: host-var-bin
116116
mountPath: /host/var/bin
117117
{{- end }}
@@ -300,7 +300,7 @@ spec:
300300
hostPath:
301301
path: /home/kubernetes/bin
302302
{{- end }}
303-
{{- if eq .Values.linux.distro "gardenlinux" }}
303+
{{- if or (eq .Values.linux.distro "gardenlinux") (eq .Values.linux.distro "flatcar") }}
304304
- name: host-var-bin
305305
hostPath:
306306
path: /var/bin

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/blobfuse2 if needed
4141
case "${DISTRIBUTION}" in
42-
"rhcos" | "rhel" | "cos" | "gardenlinux")
42+
"rhcos" | "rhel" | "cos" | "gardenlinux" | "flatcar")
4343
. ./blobfuse-proxy/install-proxy-rhcos.sh
4444
;;
4545
*)

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

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

1717
set -xe
1818

19-
BIN_PATH=${BIN_PATH:-/usr/local/bin}
20-
if [ "${DISTRIBUTION}" = "cos" ]; then
21-
echo "set BIN_PATH to /home/kubernetes/bin"
22-
BIN_PATH="/home/kubernetes/bin"
23-
fi
24-
if [ "${DISTRIBUTION}" = "gardenlinux" ]; then
25-
echo "set BIN_PATH to /var/bin"
26-
BIN_PATH="/var/bin"
27-
fi
28-
if [ "${CUSTOM_BIN_PATH}" != "" ]; then
29-
echo "set BIN_PATH to ${CUSTOM_BIN_PATH}"
30-
BIN_PATH="${CUSTOM_BIN_PATH}"
19+
if [ -z "${CUSTOM_BIN_PATH:-}" ] ; then
20+
case "${DISTRIBUTION}" in
21+
"cos")
22+
BIN_PATH="/home/kubernetes/bin" ;;
23+
"gardenlinux" | "flatcar")
24+
BIN_PATH="/var/bin" ;;
25+
*)
26+
BIN_PATH=${BIN_PATH:-/usr/local/bin} ;;
27+
esac
28+
else
29+
BIN_PATH="/${CUSTOM_BIN_PATH#/}"
3130
fi
31+
echo "set BIN_PATH to ${BIN_PATH}"
3232

3333
#copy blobfuse2 binary to BIN_PATH/blobfuse2
3434
updateBlobfuse2="true"
@@ -60,6 +60,15 @@ if [ "$updateBlobfuse2" = "true" ];then
6060
cp /usr/lib64/libfuse3.so.3* /host/usr/lib64/
6161
fi
6262
chmod 755 /host${BIN_PATH}/blobfuse2
63+
if [ "$DISTRIBUTION" = "flatcar" ] ; then
64+
find /usr/ -name 'libfuse.so.*' -exec cp '{}' /host${BIN_PATH} \;
65+
mv /host${BIN_PATH}/blobfuse2 /host${BIN_PATH}/blobfuse2.bin
66+
{
67+
echo '#!/usr/bin/bash'
68+
echo "LD_LIBRARY_PATH='${BIN_PATH}' exec ${BIN_PATH}/blobfuse2.bin \"\${@}\""
69+
} >/host${BIN_PATH}/blobfuse2
70+
chmod 755 /host${BIN_PATH}/blobfuse2
71+
fi
6372
fi
6473

6574
if [ "${INSTALL_BLOBFUSE_PROXY}" = "true" ];then
@@ -84,8 +93,9 @@ if [ "${INSTALL_BLOBFUSE_PROXY}" = "true" ];then
8493
echo "change from /usr/bin/blobfuse-proxy to ${BIN_PATH}/blobfuse-proxy in blobfuse-proxy.service"
8594
sed -i "s|/usr/bin/blobfuse-proxy|${BIN_PATH}/blobfuse-proxy|g" /blobfuse-proxy/blobfuse-proxy.service
8695
if [ "${BIN_PATH}" != "/usr/local/bin" ]; then
87-
echo "add Environment=\"PATH=${BIN_PATH}:$PATH\" in blobfuse-proxy.service"
88-
sed -i "/Delegate=yes/a Environment=\"PATH=${BIN_PATH}:\$PATH\"" /blobfuse-proxy/blobfuse-proxy.service
96+
echo "add \"PATH=${BIN_PATH}:\$PATH\" in blobfuse-proxy.service ExecStart."
97+
sed "s,^ExecStart[[:space:]]*=\\(.*\\)\$,ExecStart=/usr/bin/bash -c \"PATH=${BIN_PATH}:\$PATH \\1\"," \
98+
/blobfuse-proxy/blobfuse-proxy.service
8999
fi
90100
if [ -f "/host/etc/systemd/system/blobfuse-proxy.service" ];then
91101
old=$(sha256sum /host/etc/systemd/system/blobfuse-proxy.service | awk '{print $1}')

pkg/blobfuse-proxy/server/server.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ func getBlobfuseVersion() BlobfuseVersion {
150150
return BlobfuseV2
151151
}
152152

153+
if strings.EqualFold(osinfo.Distro, "flatcar") {
154+
klog.V(2).Info("proxy default using blobfuse V2 for mounting on Flatcar Container Linux")
155+
return BlobfuseV2
156+
}
157+
153158
klog.V(2).Info("proxy default using blobfuse V1 for mounting")
154159
return BlobfuseV1
155160
}

0 commit comments

Comments
 (0)