kind: DaemonSet
apiVersion: apps/v1
metadata:
  name: csi-azuredisk-node
  namespace: testNamespace
  labels:
    app.kubernetes.io/instance: "testRelease"
    app.kubernetes.io/managed-by: "Helm"
    app.kubernetes.io/name: "azuredisk-csi-driver"
    app.kubernetes.io/version: "v1.1.0"
    helm.sh/chart: "azuredisk-csi-driver-v1.1.0"
spec:
  updateStrategy:
    rollingUpdate:
      maxUnavailable: 1
    type: RollingUpdate
  selector:
    matchLabels:
      app: csi-azuredisk-node
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: "testRelease"
        app.kubernetes.io/managed-by: "Helm"
        app.kubernetes.io/name: "azuredisk-csi-driver"
        app.kubernetes.io/version: "v1.1.0"
        helm.sh/chart: "azuredisk-csi-driver-v1.1.0"
        app: csi-azuredisk-node
    spec:
      serviceAccountName: csi-azuredisk-node-sa
      hostNetwork: false
      nodeSelector:
        kubernetes.io/os: linux
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: type
                operator: NotIn
                values:
                - virtual-kubelet
      priorityClassName: system-node-critical
      tolerations:
        - operator: Exists
      containers:
        - name: liveness-probe
          volumeMounts:
            - mountPath: /csi
              name: socket-dir
          image: "mcr.microsoft.com/oss/kubernetes-csi/livenessprobe:v2.7.0"
          args:
            - --csi-address=/csi/csi.sock
            - --probe-timeout=3s
            - --health-port=29603
            - --v=2
          resources:
            limits:
              memory: 100Mi
            requests:
              cpu: 10m
              memory: 20Mi
        - name: node-driver-registrar
          image: "mcr.microsoft.com/oss/kubernetes-csi/csi-node-driver-registrar:v2.5.1"
          args:
            - --csi-address=$(ADDRESS)
            - --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)
            - --v=2
          livenessProbe:
            exec:
              command:
                - /csi-node-driver-registrar
                - --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)
                - --mode=kubelet-registration-probe
            initialDelaySeconds: 30
            timeoutSeconds: 15
          env:
            - name: ADDRESS
              value: /csi/csi.sock
            - name: DRIVER_REG_SOCK_PATH
              value: /var/lib/kubelet/plugins/azuredisk.csi.confidential.cloud/csi.sock
          volumeMounts:
            - name: socket-dir
              mountPath: /csi
            - name: registration-dir
              mountPath: /registration
          resources:
            limits:
              memory: 100Mi
            requests:
              cpu: 10m
              memory: 20Mi
        - name: azuredisk
          image: "ghcr.io/edgelesssys/constellation/azure-csi-driver:v1.1.0"
          args:
            - "--v=5"
            - "--endpoint=$(CSI_ENDPOINT)"
            - "--nodeid=$(KUBE_NODE_NAME)"
            - "--metrics-address=0.0.0.0:29605"
            - "--enable-perf-optimization=true"
            - "--drivername=azuredisk.csi.confidential.cloud"
            - "--volume-attach-limit=-1"
            - "--cloud-config-secret-name=azureconfig"
            - "--cloud-config-secret-namespace=kube-system"
            - "--custom-user-agent="
            - "--user-agent-suffix=OSS-helm"
            - "--allow-empty-cloud-config=true"
            - "--support-zone=true"
            - "--get-node-info-from-labels=false"
            - "--kms-addr=kms.testNamespace:9000"
          ports:
            - containerPort: 29603
              name: healthz
              protocol: TCP
          livenessProbe:
            failureThreshold: 5
            httpGet:
              path: /healthz
              port: healthz
            initialDelaySeconds: 30
            timeoutSeconds: 10
            periodSeconds: 30
          env:
            - name: AZURE_CREDENTIAL_FILE
              valueFrom:
                configMapKeyRef:
                  name: azure-cred-file
                  key: path
                  optional: true
            - name: CSI_ENDPOINT
              value: unix:///csi/csi.sock
            - name: KUBE_NODE_NAME
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: spec.nodeName
            - name: AZURE_GO_SDK_LOG_LEVEL
              value:
          imagePullPolicy: IfNotPresent
          securityContext:
            privileged: true
          volumeMounts:
            - mountPath: /csi
              name: socket-dir
            - mountPath: /var/lib/kubelet/
              mountPropagation: Bidirectional
              name: mountpoint-dir
            - mountPath: /dev
              name: device-dir
            - mountPath: /sys/bus/scsi/devices
              name: sys-devices-dir
            - mountPath: /sys/class/
              name: sys-class
            - name: cryptsetup
              mountPath: /run/cryptsetup
            - name: ssl
              mountPath: /etc/ssl/certs
              readOnly: true
            - name: ssl-pki
              mountPath: /etc/pki/ca-trust/extracted
              readOnly: true
          resources:
            limits:
              memory: 200Mi
            requests:
              cpu: 10m
              memory: 20Mi
      volumes:
        - hostPath:
            path: /var/lib/kubelet/plugins/azuredisk.csi.confidential.cloud
            type: DirectoryOrCreate
          name: socket-dir
        - hostPath:
            path: /var/lib/kubelet/
            type: DirectoryOrCreate
          name: mountpoint-dir
        - hostPath:
            path: /var/lib/kubelet/plugins_registry/
            type: DirectoryOrCreate
          name: registration-dir
        - hostPath:
            path: /dev
            type: Directory
          name: device-dir
        - hostPath:
            path: /sys/bus/scsi/devices
            type: Directory
          name: sys-devices-dir
        - hostPath:
            path: /sys/class/
            type: Directory
          name: sys-class
        - name: ssl
          hostPath:
            path: /etc/ssl/certs
        - name: ssl-pki
          hostPath:
            path: /etc/pki/ca-trust/extracted
        - name: cryptsetup
          hostPath:
            path: /run/cryptsetup
            type: Directory
