Skip to content

Commit 0e58977

Browse files
authored
Merge pull request #523 from andyzhangx/proxy-init-container
feat: download binaries from initContainer in blobfuse-proxy
2 parents 867e8a3 + 905fcd5 commit 0e58977

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

deploy/blobfuse-proxy/blobfuse-proxy.yaml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ spec:
2222
operator: NotIn
2323
values:
2424
- virtual-kubelet
25+
initContainers:
26+
- name: prepare-binaries
27+
image: mcr.microsoft.com/oss/nginx/nginx:1.17.3-alpine
28+
command: ['sh', '-c', "wget -O /tmp/blobfuse-proxy-v0.1.0.deb https://github.com/kubernetes-sigs/blob-csi-driver/raw/master/deploy/blobfuse-proxy/v0.1.0/blobfuse-proxy-v0.1.0.deb;wget -O /tmp/packages-microsoft-prod.deb https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb"]
29+
volumeMounts:
30+
- mountPath: /tmp
31+
name: tmp-dir
2532
containers:
2633
- command:
2734
- nsenter
@@ -39,21 +46,15 @@ spec:
3946
set -xe
4047
if (( "${INSTALL_BLOBFUSE}" == "true" ))
4148
then
42-
wget -O /tmp/packages-microsoft-prod.deb https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
4349
dpkg -i /tmp/packages-microsoft-prod.deb
4450
apt-get update && apt-get install -y blobfuse
45-
rm -f /tmp/packages-microsoft-prod.deb
4651
fi
47-
# download blobfuse-proxy .deb package
48-
wget -O /tmp/blobfuse-proxy-v0.1.0.deb https://github.com/kubernetes-sigs/blob-csi-driver/raw/master/deploy/blobfuse-proxy/v0.1.0/blobfuse-proxy-v0.1.0.deb
4952
dpkg -i /tmp/blobfuse-proxy-v0.1.0.deb
5053
mkdir -p /var/lib/kubelet/plugins/blob.csi.azure.com
5154
echo "Enabling blobfuse proxy systemctl service"
5255
systemctl daemon-reload
5356
systemctl enable blobfuse-proxy
5457
systemctl start blobfuse-proxy
55-
echo "removing the file: /tmp/blobfuse-proxy-v0.1.0.deb"
56-
rm -f /tmp/blobfuse-proxy-v0.1.0.deb
5758
echo "waiting for blobfuse-proxy service to start"
5859
sleep 3s
5960
# tail blobfuse proxy logs
@@ -69,7 +70,6 @@ spec:
6970
cpu: 10m
7071
securityContext:
7172
privileged: true
72-
dnsPolicy: ClusterFirstWithHostNet
7373
hostNetwork: true
7474
hostPID: true
7575
nodeSelector:
@@ -78,3 +78,8 @@ spec:
7878
restartPolicy: Always
7979
tolerations:
8080
- operator: Exists
81+
volumes:
82+
- hostPath:
83+
path: /tmp
84+
type: DirectoryOrCreate
85+
name: tmp-dir

0 commit comments

Comments
 (0)