|
| 1 | +--- |
| 2 | +# This YAML file contains driver-registrar & csi driver nodeplugin API objects |
| 3 | +# that are necessary to run CSI nodeplugin for iscsi |
| 4 | +kind: DaemonSet |
| 5 | +apiVersion: apps/v1 |
| 6 | +metadata: |
| 7 | + name: csi-iscsi-node |
| 8 | + namespace: kube-system |
| 9 | +spec: |
| 10 | + selector: |
| 11 | + matchLabels: |
| 12 | + app: csi-iscsi-node |
| 13 | + template: |
| 14 | + metadata: |
| 15 | + labels: |
| 16 | + app: csi-iscsi-node |
| 17 | + spec: |
| 18 | + hostNetwork: true # original iscsi connection would be broken without hostNetwork setting |
| 19 | + dnsPolicy: ClusterFirstWithHostNet |
| 20 | + nodeSelector: |
| 21 | + kubernetes.io/os: linux |
| 22 | + containers: |
| 23 | + - name: liveness-probe |
| 24 | + image: k8s.gcr.io/sig-storage/livenessprobe:v2.1.0 |
| 25 | + args: |
| 26 | + - --csi-address=/csi/csi.sock |
| 27 | + - --probe-timeout=3s |
| 28 | + - --health-port=29653 |
| 29 | + - --v=2 |
| 30 | + volumeMounts: |
| 31 | + - name: socket-dir |
| 32 | + mountPath: /csi |
| 33 | + resources: |
| 34 | + limits: |
| 35 | + cpu: 100m |
| 36 | + memory: 100Mi |
| 37 | + requests: |
| 38 | + cpu: 10m |
| 39 | + memory: 20Mi |
| 40 | + - name: node-driver-registrar |
| 41 | + image: k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.1.0 |
| 42 | + lifecycle: |
| 43 | + preStop: |
| 44 | + exec: |
| 45 | + command: ["/bin/sh", "-c", "rm -rf /registration/iscsi.csi.k8s.io /registration/iscsi.csi.k8s.io-reg.sock"] |
| 46 | + args: |
| 47 | + - --v=2 |
| 48 | + - --csi-address=/csi/csi.sock |
| 49 | + - --kubelet-registration-path=/var/lib/kubelet/plugins/iscsi.csi.k8s.io/csi.sock |
| 50 | + env: |
| 51 | + - name: KUBE_NODE_NAME |
| 52 | + valueFrom: |
| 53 | + fieldRef: |
| 54 | + fieldPath: spec.nodeName |
| 55 | + volumeMounts: |
| 56 | + - name: socket-dir |
| 57 | + mountPath: /csi |
| 58 | + - name: registration-dir |
| 59 | + mountPath: /registration |
| 60 | + - name: iscsi |
| 61 | + securityContext: |
| 62 | + privileged: true |
| 63 | + capabilities: |
| 64 | + add: ["SYS_ADMIN"] |
| 65 | + allowPrivilegeEscalation: true |
| 66 | + image: quay.io/humble/csi-iscsi:v0.1 |
| 67 | + args: |
| 68 | + - "-v=5" |
| 69 | + - "--nodeid=$(NODE_ID)" |
| 70 | + - "--endpoint=$(CSI_ENDPOINT)" |
| 71 | + env: |
| 72 | + - name: NODE_ID |
| 73 | + valueFrom: |
| 74 | + fieldRef: |
| 75 | + fieldPath: spec.nodeName |
| 76 | + - name: CSI_ENDPOINT |
| 77 | + value: unix:///csi/csi.sock |
| 78 | + ports: |
| 79 | + - containerPort: 29653 |
| 80 | + name: healthz |
| 81 | + protocol: TCP |
| 82 | + livenessProbe: |
| 83 | + failureThreshold: 5 |
| 84 | + httpGet: |
| 85 | + path: /healthz |
| 86 | + port: healthz |
| 87 | + initialDelaySeconds: 30 |
| 88 | + timeoutSeconds: 10 |
| 89 | + periodSeconds: 30 |
| 90 | + imagePullPolicy: "IfNotPresent" |
| 91 | + volumeMounts: |
| 92 | + - name: socket-dir |
| 93 | + mountPath: /csi |
| 94 | + - name: pods-mount-dir |
| 95 | + mountPath: /var/lib/kubelet/pods |
| 96 | + mountPropagation: "Bidirectional" |
| 97 | + volumes: |
| 98 | + - name: socket-dir |
| 99 | + hostPath: |
| 100 | + path: /var/lib/kubelet/plugins/iscsi.csi.k8s.io |
| 101 | + type: DirectoryOrCreate |
| 102 | + - name: pods-mount-dir |
| 103 | + hostPath: |
| 104 | + path: /var/lib/kubelet/pods |
| 105 | + type: Directory |
| 106 | + - hostPath: |
| 107 | + path: /var/lib/kubelet/plugins_registry |
| 108 | + type: Directory |
| 109 | + name: registration-dir |
0 commit comments