Skip to content

Commit d0d8400

Browse files
committed
feat: add blobfuse-proxy into helm chart
fix uninstall add resources fix yaml lint
1 parent d8a6366 commit d0d8400

File tree

5 files changed

+152
-56
lines changed

5 files changed

+152
-56
lines changed
578 Bytes
Binary file not shown.
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{{- if .Values.node.enableBlobfuseProxy -}}
2+
apiVersion: apps/v1
3+
kind: DaemonSet
4+
metadata:
5+
name: csi-blobfuse-proxy
6+
namespace: kube-system
7+
spec:
8+
selector:
9+
matchLabels:
10+
app: csi-blobfuse-proxy
11+
template:
12+
metadata:
13+
labels:
14+
app: csi-blobfuse-proxy
15+
spec:
16+
affinity:
17+
nodeAffinity:
18+
requiredDuringSchedulingIgnoredDuringExecution:
19+
nodeSelectorTerms:
20+
- matchExpressions:
21+
- key: type
22+
operator: NotIn
23+
values:
24+
- virtual-kubelet
25+
initContainers:
26+
- name: prepare-binaries
27+
image: "{{ .Values.image.blob.repository }}:{{ .Values.image.blob.tag }}"
28+
command: ['sh', '-c', "cp /blobfuse-proxy/*.deb /tmp/"]
29+
volumeMounts:
30+
- mountPath: /tmp
31+
name: tmp-dir
32+
containers:
33+
- command:
34+
- nsenter
35+
- '--target'
36+
- '1'
37+
- '--mount'
38+
- '--uts'
39+
- '--ipc'
40+
- '--net'
41+
- '--pid'
42+
- '--'
43+
- sh
44+
- '-c'
45+
- |
46+
set -xe
47+
dpkg -i /tmp/packages-microsoft-prod.deb
48+
apt-get install -y blobfuse
49+
dpkg -i /tmp/blobfuse-proxy.deb
50+
rm -f /tmp/packages-microsoft-prod.deb /tmp/blobfuse-proxy.deb
51+
mkdir -p /var/lib/kubelet/plugins/blob.csi.azure.com
52+
echo "set max open file num"
53+
sysctl -w fs.file-max=9000000
54+
echo "Enabling blobfuse proxy systemctl service"
55+
systemctl daemon-reload
56+
systemctl enable blobfuse-proxy
57+
systemctl start blobfuse-proxy
58+
echo "waiting for blobfuse-proxy service to start"
59+
sleep 3s
60+
# tail blobfuse proxy logs
61+
journalctl -u blobfuse-proxy -f
62+
image: "{{ .Values.image.blob.repository }}:{{ .Values.image.blob.tag }}"
63+
imagePullPolicy: IfNotPresent
64+
name: sysctl-install-blobfuse-proxy
65+
env:
66+
- name: "DEBIAN_FRONTEND"
67+
value: "noninteractive"
68+
resources:
69+
limits:
70+
cpu: 100m
71+
memory: 100Mi
72+
requests:
73+
cpu: 10m
74+
memory: 1Mi
75+
securityContext:
76+
privileged: true
77+
hostNetwork: true
78+
hostPID: true
79+
nodeSelector:
80+
kubernetes.io/os: linux
81+
priorityClassName: system-node-critical
82+
restartPolicy: Always
83+
tolerations:
84+
- operator: Exists
85+
volumes:
86+
- hostPath:
87+
path: /tmp
88+
type: DirectoryOrCreate
89+
name: tmp-dir
90+
{{ end }}

deploy/blobfuse-proxy.yaml

Lines changed: 50 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -23,53 +23,57 @@ spec:
2323
values:
2424
- virtual-kubelet
2525
initContainers:
26-
- name: prepare-binaries
27-
image: mcr.microsoft.com/k8s/csi/blob-csi:latest
28-
command: ['sh', '-c', "cp /blobfuse-proxy/*.deb /tmp/"]
29-
volumeMounts:
30-
- mountPath: /tmp
31-
name: tmp-dir
26+
- name: prepare-binaries
27+
image: mcr.microsoft.com/k8s/csi/blob-csi:latest
28+
command: ['sh', '-c', "cp /blobfuse-proxy/*.deb /tmp/"]
29+
volumeMounts:
30+
- mountPath: /tmp
31+
name: tmp-dir
3232
containers:
33-
- command:
34-
- nsenter
35-
- '--target'
36-
- '1'
37-
- '--mount'
38-
- '--uts'
39-
- '--ipc'
40-
- '--net'
41-
- '--pid'
42-
- '--'
43-
- sh
44-
- '-c'
45-
- |
46-
set -xe
47-
dpkg -i /tmp/packages-microsoft-prod.deb
48-
apt-get install -y blobfuse
49-
dpkg -i /tmp/blobfuse-proxy.deb
50-
rm -f /tmp/packages-microsoft-prod.deb /tmp/blobfuse-proxy.deb
51-
mkdir -p /var/lib/kubelet/plugins/blob.csi.azure.com
52-
echo "set max open file num"
53-
sysctl -w fs.file-max=9000000
54-
echo "Enabling blobfuse proxy systemctl service"
55-
systemctl daemon-reload
56-
systemctl enable blobfuse-proxy
57-
systemctl start blobfuse-proxy
58-
echo "waiting for blobfuse-proxy service to start"
59-
sleep 3s
60-
# tail blobfuse proxy logs
61-
journalctl -u blobfuse-proxy -f
62-
image: mcr.microsoft.com/k8s/csi/blob-csi:latest
63-
imagePullPolicy: IfNotPresent
64-
name: sysctl-install-blobfuse-proxy
65-
env:
66-
- name: "DEBIAN_FRONTEND"
67-
value: "noninteractive"
68-
resources:
69-
requests:
70-
cpu: 10m
71-
securityContext:
72-
privileged: true
33+
- command:
34+
- nsenter
35+
- '--target'
36+
- '1'
37+
- '--mount'
38+
- '--uts'
39+
- '--ipc'
40+
- '--net'
41+
- '--pid'
42+
- '--'
43+
- sh
44+
- '-c'
45+
- |
46+
set -xe
47+
dpkg -i /tmp/packages-microsoft-prod.deb
48+
apt-get install -y blobfuse
49+
dpkg -i /tmp/blobfuse-proxy.deb
50+
rm -f /tmp/packages-microsoft-prod.deb /tmp/blobfuse-proxy.deb
51+
mkdir -p /var/lib/kubelet/plugins/blob.csi.azure.com
52+
echo "set max open file num"
53+
sysctl -w fs.file-max=9000000
54+
echo "Enabling blobfuse proxy systemctl service"
55+
systemctl daemon-reload
56+
systemctl enable blobfuse-proxy
57+
systemctl start blobfuse-proxy
58+
echo "waiting for blobfuse-proxy service to start"
59+
sleep 3s
60+
# tail blobfuse proxy logs
61+
journalctl -u blobfuse-proxy -f
62+
image: mcr.microsoft.com/k8s/csi/blob-csi:latest
63+
imagePullPolicy: IfNotPresent
64+
name: sysctl-install-blobfuse-proxy
65+
env:
66+
- name: "DEBIAN_FRONTEND"
67+
value: "noninteractive"
68+
resources:
69+
limits:
70+
cpu: 100m
71+
memory: 100Mi
72+
requests:
73+
cpu: 10m
74+
memory: 1Mi
75+
securityContext:
76+
privileged: true
7377
hostNetwork: true
7478
hostPID: true
7579
nodeSelector:

deploy/blobfuse-proxy/README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
# Blobfuse Proxy
22
- supported CSI driver version: v1.1.0 or later version
3-
- only available on debian based OS
3+
- only available on debian based agent node
44

55
By default, restart csi-blobfuse-node daemonset would make current blobfuse mounts unavailable. When fuse nodeserver restarts on the node, the fuse daemon also restarts, this results in breaking all connections FUSE daemon is maintaining. You could find more details here: [No easy way how to update CSI driver that uses fuse](https://github.com/kubernetes/kubernetes/issues/70013).
66

7-
This guide shows how to install a blobfuse proxy on all agent nodes and the proxy would mount volumes, maintain FUSE connections.
7+
This guide shows how to install a blobfuse proxy on all agent nodes and the proxy would mount volumes, maintain FUSE connections.
88

9-
### Step#1. Install blobfuse-proxy on debian based agent nodes
10-
> following daemonset would also install latest [blobfuse](https://github.com/Azure/azure-storage-fuse) version on the node by default.
9+
### Install Blob CSI driver with `node.enableBlobfuseProxy=true`
10+
- helm install
1111
```console
12-
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/blob-csi-driver/master/deploy/blobfuse-proxy.yaml
12+
helm repo add blob-csi-driver https://raw.githubusercontent.com/kubernetes-sigs/blob-csi-driver/master/charts
13+
helm install blob-csi-driver blob-csi-driver/blob-csi-driver --namespace kube-system --version v1.6.0 --set node.enableBlobfuseProxy=true
1314
```
1415

15-
### Step#2. Install Blob CSI driver with `node.enableBlobfuseProxy=true` helm chart setting
16-
> another opition: set `enable-blobfuse-proxy=true` in existing `csi-blob-node` daemonset (default is `false`)
16+
### Enable blobfuse proxy on existing Blob CSI driver
17+
- install blobfuse proxy
18+
> following config only works on debian based agent node
1719
```console
18-
helm repo add blob-csi-driver https://raw.githubusercontent.com/kubernetes-sigs/blob-csi-driver/master/charts
19-
helm install blob-csi-driver blob-csi-driver/blob-csi-driver --namespace kube-system --version v1.4.0 --set node.enableBlobfuseProxy=true
20+
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/blob-csi-driver/master/deploy/blobfuse-proxy.yaml
2021
```
22+
- set `enable-blobfuse-proxy=true` in existing `csi-blob-node` daemonset (default is `false`)

deploy/uninstall-driver.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ fi
3636
if [[ "$#" -gt 1 ]]; then
3737
if [[ "$2" == *"blobfuse-proxy"* ]]; then
3838
echo "remove blobfuse-proxy deployment ..."
39-
kubectl delete -f ./deploy/blobfuse-proxy/blobfuse-proxy.yaml
39+
kubectl delete -f ./deploy/blobfuse-proxy.yaml
4040
fi
4141
fi
4242

0 commit comments

Comments
 (0)