Skip to content

Commit 2b428ad

Browse files
committed
change blobfuse-proxy from daemonset to initContainer
1 parent 44f646c commit 2b428ad

File tree

17 files changed

+156
-292
lines changed

17 files changed

+156
-292
lines changed

.github/workflows/linux.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ jobs:
4141
run: |
4242
export PATH=$PATH:$HOME/.local/bin
4343
make blobfuse-proxy
44-
sudo dpkg -i _output/blobfuse-proxy.deb
4544
4645
- name: Get code coverage
4746
env:

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,3 @@ cscope.*
6969
/bazel-*
7070
*.pyc
7171
profile.cov
72-
73-
pkg/blobfuse-proxy/debpackage/usr/

Makefile

+1-3
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,4 @@ delete-metrics-svc:
178178

179179
.PHONY: blobfuse-proxy
180180
blobfuse-proxy:
181-
mkdir -p ./pkg/blobfuse-proxy/debpackage/usr/bin/ ./_output
182-
CGO_ENABLED=0 GOOS=linux go build -mod vendor -ldflags="-s -w" -o ./pkg/blobfuse-proxy/debpackage/usr/bin/blobfuse-proxy ./pkg/blobfuse-proxy
183-
$(DPKG_DEB) --build pkg/blobfuse-proxy/debpackage ./_output/blobfuse-proxy.deb
181+
CGO_ENABLED=0 GOOS=linux go build -mod vendor -ldflags="-s -w" -o _output/${ARCH}/blobfuse-proxy ./pkg/blobfuse-proxy
-596 Bytes
Binary file not shown.

charts/latest/blob-csi-driver/templates/blobfuse-proxy.yaml

-126
This file was deleted.

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

+43
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ spec:
3232
imagePullSecrets:
3333
{{ toYaml .Values.imagePullSecrets | indent 8 }}
3434
{{- end }}
35+
{{- if .Values.node.enableBlobfuseProxy }}
36+
hostPID: true
37+
{{- end }}
3538
hostNetwork: true
3639
dnsPolicy: Default
3740
serviceAccountName: {{ .Values.serviceAccount.node }}
@@ -56,6 +59,38 @@ spec:
5659
{{- with .Values.node.tolerations }}
5760
tolerations:
5861
{{ toYaml . | indent 8 }}
62+
{{- end }}
63+
{{- if .Values.node.enableBlobfuseProxy }}
64+
initContainers:
65+
- name: install-blobfuse-proxy
66+
{{- if hasPrefix "/" .Values.image.blob.repository }}
67+
image: "{{ .Values.image.baseRepo }}{{ .Values.image.blob.repository }}:{{ .Values.image.blob.tag }}"
68+
{{- else }}
69+
image: "{{ .Values.image.blob.repository }}:{{ .Values.image.blob.tag }}"
70+
{{- end }}
71+
imagePullPolicy: IfNotPresent
72+
command:
73+
- "/blobfuse-proxy/init.sh"
74+
securityContext:
75+
privileged: true
76+
env:
77+
- name: DEBIAN_FRONTEND
78+
value: "noninteractive"
79+
- name: INSTALL_BLOBFUSE
80+
value: "{{ .Values.node.blobfuseProxy.installBlobfuse }}"
81+
- name: BLOBFUSE_VERSION
82+
value: "{{ .Values.node.blobfuseProxy.blobfuseVersion }}"
83+
- name: SET_MAX_OPEN_FILE_NUM
84+
value: "{{ .Values.node.blobfuseProxy.setMaxOpenFileNum }}"
85+
- name: MAX_FILE_NUM
86+
value: "{{ .Values.node.blobfuseProxy.maxOpenFileNum }}"
87+
- name: DISABLE_UPDATEDB
88+
value: "{{ .Values.node.blobfuseProxy.disableUpdateDB }}"
89+
volumeMounts:
90+
- name: host-usr
91+
mountPath: /host/usr
92+
- name: host-etc
93+
mountPath: /host/etc
5994
{{- end }}
6095
containers:
6196
- name: liveness-probe
@@ -188,6 +223,14 @@ spec:
188223
{{- end }}
189224
resources: {{- toYaml .Values.node.resources.blob | nindent 12 }}
190225
volumes:
226+
{{- if .Values.node.enableBlobfuseProxy }}
227+
- name: host-usr
228+
hostPath:
229+
path: /usr
230+
- name: host-etc
231+
hostPath:
232+
path: /etc
233+
{{- end }}
191234
- hostPath:
192235
path: {{ .Values.linux.kubelet }}/plugins/{{ .Values.driver.name }}
193236
type: DirectoryOrCreate

charts/latest/blob-csi-driver/values.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,6 @@ node:
148148
nodeSelector: {}
149149
tolerations:
150150
- operator: "Exists"
151-
livenessProbe:
152-
healthPort: 29633
153151

154152
feature:
155153
enableFSGroupPolicy: false

deploy/blobfuse-proxy.yaml

-115
This file was deleted.

deploy/csi-blob-node.yaml

+33
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ spec:
1818
app: csi-blob-node
1919
spec:
2020
hostNetwork: true
21+
hostPID: true
2122
dnsPolicy: Default
2223
serviceAccountName: csi-blob-node-sa
2324
nodeSelector:
@@ -34,6 +35,32 @@ spec:
3435
priorityClassName: system-node-critical
3536
tolerations:
3637
- operator: "Exists"
38+
initContainers:
39+
- name: install-blobfuse-proxy
40+
image: mcr.microsoft.com/k8s/csi/blob-csi:latest
41+
imagePullPolicy: IfNotPresent
42+
command:
43+
- "/blobfuse-proxy/init.sh"
44+
securityContext:
45+
privileged: true
46+
env:
47+
- name: DEBIAN_FRONTEND
48+
value: "noninteractive"
49+
- name: INSTALL_BLOBFUSE
50+
value: "true"
51+
- name: BLOBFUSE_VERSION
52+
value: 1.4.4
53+
- name: SET_MAX_OPEN_FILE_NUM
54+
value: "true"
55+
- name: MAX_FILE_NUM
56+
value: "9000000"
57+
- name: DISABLE_UPDATEDB
58+
value: "true"
59+
volumeMounts:
60+
- name: host-usr
61+
mountPath: /host/usr
62+
- name: host-etc
63+
mountPath: /host/etc
3764
containers:
3865
- name: liveness-probe
3966
volumeMounts:
@@ -139,6 +166,12 @@ spec:
139166
cpu: 10m
140167
memory: 20Mi
141168
volumes:
169+
- name: host-usr
170+
hostPath:
171+
path: /usr
172+
- name: host-etc
173+
hostPath:
174+
path: /etc
142175
- hostPath:
143176
path: /var/lib/kubelet/plugins/blob.csi.azure.com
144177
type: DirectoryOrCreate

deploy/install-driver.sh

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ kubectl apply -f $repo/csi-blob-controller.yaml
4242
if [[ "$#" -gt 1 ]]; then
4343
if [[ "$2" == *"blobfuse-proxy"* ]]; then
4444
echo "set enable-blobfuse-proxy as true ..."
45-
kubectl apply -f $repo/blobfuse-proxy.yaml
4645
if [[ "$2" == *"local"* ]]; then
4746
cat $repo/csi-blob-node.yaml | sed 's/enable-blobfuse-proxy=false/enable-blobfuse-proxy=true/g' | kubectl apply -f -
4847
else

0 commit comments

Comments
 (0)