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