apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: csi-plugin
  namespace: kube-system
spec:
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: csi-plugin
  template:
    metadata:
      labels:
        app: csi-plugin
    spec:
      containers:
      - args:
        - --v=5
        - --csi-address=/home/test/kubernetes/lib/kubelet/csi-plugins/diskplugin.csi.alibabacloud.com/csi.sock
        - --kubelet-registration-path=/home/test/kubernetes/lib/kubelet/csi-plugins/diskplugin.csi.alibabacloud.com/csi.sock
        image: csi-node-driver-registrar:v1.2.0
        imagePullPolicy: IfNotPresent
        name: disk-driver-registrar
        resources: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /home/test/kubernetes/lib/kubelet/
          mountPropagation: HostToContainer
          name: kubelet-dir
        - mountPath: /registration
          name: registration-dir
      - args:
        - --endpoint=$(CSI_ENDPOINT)
        - --v=5
        - --driver=disk
        - --nodeid=$(KUBE_NODE_NAME)
        env:
        - name: CSI_ENDPOINT
          value: unix://home/test/kubernetes/lib/kubelet/csi-plugins/driverplugin.csi.alibabacloud.com-replace/csi.sock
        - name: SERVICE_TYPE
          value: plugin
        - name: KUBELET_ROOT_DIR
          value: /home/test/kubernetes/lib/kubelet
        - name: MAX_VOLUMES_PERNODE
          value: "15"
        - name: KUBE_NODE_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: spec.nodeName
        image: csi-plugin
        imagePullPolicy: IfNotPresent
        livenessProbe:
          failureThreshold: 5
          httpGet:
            path: /healthz
            port: 11260
            scheme: HTTP
          initialDelaySeconds: 10
          periodSeconds: 30
          successThreshold: 1
          timeoutSeconds: 5
        name: csi-plugin
        resources: {}
        securityContext:
          allowPrivilegeEscalation: true
          capabilities:
            add:
            - SYS_ADMIN
          privileged: true
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /home/test/kubernetes/lib/kubelet
          mountPropagation: Bidirectional
          name: kubelet-dir
        - mountPath: /home/test/kubernetes/lib/container
          mountPropagation: Bidirectional
          name: container-dir
        - mountPath: /dev
          mountPropagation: HostToContainer
          name: host-dev
        - mountPath: /var/log/
          mountPropagation: HostToContainer
          name: host-log
        - mountPath: /host/etc
          mountPropagation: HostToContainer
          name: host-etc
        - mountPath: /var/run/node-extender-server
          name: servicesocket
        - mountPath: /host/sys
          name: host-sys
        - mountPath: /host/dev/mem
          name: host-mem
      dnsPolicy: ClusterFirst
      hostNetwork: true
      hostPID: true
      priorityClassName: system-node-critical
      restartPolicy: Always
      schedulerName: kube-scheduler
      securityContext: {}
      serviceAccount: alicloud-csi-plugin
      serviceAccountName: alicloud-csi-plugin
      terminationGracePeriodSeconds: 30
      tolerations:
      - operator: Exists
      volumes:
      - hostPath:
          path: /home/test/kubernetes/lib/kubelet/plugins_registry
          type: DirectoryOrCreate
        name: registration-dir
      - hostPath:
          path: /home/test/kubernetes/lib
          type: DirectoryOrCreate
        name: container-dir
      - hostPath:
          path: /home/test/kubernetes/lib/kubelet
          type: Directory
        name: kubelet-dir
      - hostPath:
          path: /dev
          type: ""
        name: host-dev
      - hostPath:
          path: /var/log/
          type: ""
        name: host-log
      - hostPath:
          path: /sys/
          type: ""
        name: host-sys
      - hostPath:
          path: /etc
          type: ""
        name: host-etc
      - hostPath:
          path: /dev/mem
          type: ""
        name: host-mem
      - hostPath:
          path: /var/run/node-extender-server
          type: DirectoryOrCreate
        name: servicesocket
  updateStrategy:
    rollingUpdate:
      maxUnavailable: 5
    type: RollingUpdate
