kind: Deployment
apiVersion: apps/v1
metadata:
  namespace: ovc-disk-csi
  name: ovc-disk-csi-driver-attacher
spec:
  replicas: 1
  selector:
    matchLabels:
      app: ovc-disk-csi-driver-attacher
  template:
    metadata:
      labels:
        app: ovc-disk-csi-driver-attacher
    spec:
      serviceAccountName: csi-attacher
      containers:
        - name: csi-attacher
          image: quay.io/k8scsi/csi-attacher:v1.0.1
          securityContext:
            privileged: true
            capabilities:
              add: ["SYS_ADMIN"]
            allowPrivilegeEscalation: true
          args:
            - --v=5
            - --csi-address=$(ADDRESS)
          env:
            - name: ADDRESS
              value: /var/lib/csi/sockets/pluginproxy/csi.sock
          imagePullPolicy: Always
          volumeMounts:
          - name: socket-dir
            mountPath: /var/lib/csi/sockets/pluginproxy/
        - name: ovc-plugin
          image: gigtech/ovc-disk-csi-driver
          imagePullPolicy: Always
          args:
            - "--endpoint=$(CSI_ENDPOINT)"
            - "--url=$(OVC_URL)"
            - "--account=$(OVC_ACCOUNT)"
            - "--verbose"
          env:
            - name: CSI_ENDPOINT
              value: unix:///var/lib/csi/sockets/pluginproxy/csi.sock
            - name: KUBE_NODE_NAME
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: spec.nodeName
            - name: OVC_JWT
              valueFrom:
                secretKeyRef:
                  name: ovc-disk-csi-driver-secret
                  key: client_jwt
            - name: OVC_URL
              valueFrom:
                secretKeyRef:
                  name: ovc-disk-csi-driver-secret
                  key: url
            - name: OVC_ACCOUNT
              valueFrom:
                secretKeyRef:
                  name: ovc-disk-csi-driver-secret
                  key: account
          imagePullPolicy: Always
          securityContext:
            privileged: true
            capabilities:
              add: ["SYS_ADMIN"]
          volumeMounts:
            - name: socket-dir
              mountPath: /var/lib/csi/sockets/pluginproxy/
      volumes:
        - name: socket-dir
          emptyDir: {}
