kind: Deployment
apiVersion: apps/v1
metadata:
  name: csi-azuredisk-controller
  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:
  replicas: 1
  selector:
    matchLabels:
      app: csi-azuredisk-controller
  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-controller
    spec:
      serviceAccountName: csi-azuredisk-controller-sa
      hostNetwork: false
      nodeSelector:
        kubernetes.io/os: linux
        node-role.kubernetes.io/control-plane: ""
      priorityClassName: system-cluster-critical
      tolerations:
        - effect: NoSchedule
          key: node-role.kubernetes.io/master
          operator: Exists
        - effect: NoSchedule
          key: node-role.kubernetes.io/controlplane
          operator: Exists
        - effect: NoSchedule
          key: node-role.kubernetes.io/control-plane
          operator: Exists
        - effect: NoSchedule
          key: node.cloudprovider.kubernetes.io/uninitialized
          operator: Exists
        - effect: NoSchedule
          key: node.kubernetes.io/not-ready
          operator: Exists
      containers:
        - name: csi-provisioner
          image: "mcr.microsoft.com/oss/kubernetes-csi/csi-provisioner:v3.2.0"
          args:
            - "--feature-gates=Topology=true"
            - "--csi-address=$(ADDRESS)"
            - "--v=2"
            - "--timeout=15s"
            - "--leader-election"
            - "--leader-election-namespace=testNamespace"
            - "--worker-threads=100"
            - "--extra-create-metadata=true"
            - "--strict-topology=true"
            - "--kube-api-qps=50"
            - "--kube-api-burst=100"
          env:
            - name: ADDRESS
              value: /csi/csi.sock
          volumeMounts:
            - mountPath: /csi
              name: socket-dir
          resources:
            limits:
              memory: 500Mi
            requests:
              cpu: 10m
              memory: 20Mi
        - name: csi-attacher
          image: "mcr.microsoft.com/oss/kubernetes-csi/csi-attacher:v3.5.0"
          args:
            - "-v=2"
            - "-csi-address=$(ADDRESS)"
            - "-timeout=1200s"
            - "-leader-election"
            - "--leader-election-namespace=testNamespace"
            - "-worker-threads=500"
            - "-kube-api-qps=50"
            - "-kube-api-burst=100"
          env:
            - name: ADDRESS
              value: /csi/csi.sock
          volumeMounts:
          - mountPath: /csi
            name: socket-dir
          resources:
            limits:
              memory: 500Mi
            requests:
              cpu: 10m
              memory: 20Mi
        - name: csi-snapshotter
          image: "mcr.microsoft.com/oss/kubernetes-csi/csi-snapshotter:v5.0.1"
          args:
            - "-csi-address=$(ADDRESS)"
            - "-leader-election"
            - "--leader-election-namespace=testNamespace"
            - "-v=2"
          env:
            - name: ADDRESS
              value: /csi/csi.sock
          volumeMounts:
            - name: socket-dir
              mountPath: /csi
          resources:
            limits:
              memory: 100Mi
            requests:
              cpu: 10m
              memory: 20Mi
        - name: csi-resizer
          image: "mcr.microsoft.com/oss/kubernetes-csi/csi-resizer:v1.5.0"
          args:
            - "-csi-address=$(ADDRESS)"
            - "-v=2"
            - "-leader-election"
            - "--leader-election-namespace=testNamespace"
            - '-handle-volume-inuse-error=false'
            - '-feature-gates=RecoverVolumeExpansionFailure=true'
            - "-timeout=240s"
          env:
            - name: ADDRESS
              value: /csi/csi.sock
          volumeMounts:
            - name: socket-dir
              mountPath: /csi
          resources:
            limits:
              memory: 500Mi
            requests:
              cpu: 10m
              memory: 20Mi
        - name: liveness-probe
          image: "mcr.microsoft.com/oss/kubernetes-csi/livenessprobe:v2.7.0"
          args:
            - --csi-address=/csi/csi.sock
            - --probe-timeout=3s
            - --health-port=29602
            - --v=2
          volumeMounts:
            - name: socket-dir
              mountPath: /csi
          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)"
            - "--metrics-address=0.0.0.0:29604"
            - "--disable-avset-nodes=false"
            - "--vm-type="
            - "--drivername=azuredisk.csi.confidential.cloud"
            - "--cloud-config-secret-name=azureconfig"
            - "--cloud-config-secret-namespace=kube-system"
            - "--custom-user-agent="
            - "--user-agent-suffix=OSS-helm"
            - "--allow-empty-cloud-config=false"
            - "--vmss-cache-ttl-seconds=-1"
          ports:
            - containerPort: 29602
              name: healthz
              protocol: TCP
            - containerPort: 29604
              name: metrics
              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: AZURE_GO_SDK_LOG_LEVEL
              value:
          imagePullPolicy: IfNotPresent
          volumeMounts:
            - mountPath: /csi
              name: socket-dir
            - name: ssl
              mountPath: /etc/ssl/certs
              readOnly: true
            - name: ssl-pki
              mountPath: /etc/pki/ca-trust/extracted
              readOnly: true
          resources:
            limits:
              memory: 500Mi
            requests:
              cpu: 10m
              memory: 20Mi
      volumes:
        - name: socket-dir
          emptyDir: {}
        - name: ssl
          hostPath:
            path: /etc/ssl/certs
        - name: ssl-pki
          hostPath:
            path: /etc/pki/ca-trust/extracted
