apiVersion: apps/v1
kind: Deployment
metadata:
  name: objectstorage-provisioner
  labels:
    app.kubernetes.io/part-of: container-object-storage-interface
    app.kubernetes.io/component: driver-sample
    app.kubernetes.io/version: main
    app.kubernetes.io/name: cosi-driver-sample
spec:
  replicas: 1
  minReadySeconds: 30
  progressDeadlineSeconds: 600
  revisionHistoryLimit: 3
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
  selector:
    matchLabels:
      app.kubernetes.io/part-of: container-object-storage-interface
      app.kubernetes.io/component: driver-sample
      app.kubernetes.io/version: main
      app.kubernetes.io/name: cosi-driver-sample
  template:
    metadata:
      labels:
        app.kubernetes.io/part-of: container-object-storage-interface
        app.kubernetes.io/component: driver-sample
        app.kubernetes.io/version: main
        app.kubernetes.io/name: cosi-driver-sample
    spec:
      serviceAccountName: objectstorage-provisioner-sa
      volumes:
      - name: socket
        emptyDir: {}
      containers:
      - name: cosi-driver
        image: sample-cosi-driver:latest
        imagePullPolicy: IfNotPresent
        envFrom:
        - secretRef:
            name: objectstorage-provisioner
        volumeMounts:
        - mountPath: /var/lib/cosi
          name: socket
      - name: objectstorage-provisioner-sidecar
        image: objectstorage-sidecar:latest
        imagePullPolicy: IfNotPresent
        envFrom:
        - secretRef:
            name: objectstorage-provisioner
        env:
        - name: POD_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        volumeMounts:
        - mountPath: /var/lib/cosi
          name: socket
