apiVersion: v1
kind: ServiceAccount
metadata:
  creationTimestamp: null
  labels:
    addon.kops.k8s.io/name: aws-ebs-csi-driver.addons.k8s.io
    app.kubernetes.io/instance: aws-ebs-csi-driver
    app.kubernetes.io/managed-by: kops
    app.kubernetes.io/name: aws-ebs-csi-driver
    app.kubernetes.io/version: v1.8.0
    k8s-addon: aws-ebs-csi-driver.addons.k8s.io
  name: ebs-csi-controller-sa
  namespace: kube-system

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  creationTimestamp: null
  labels:
    addon.kops.k8s.io/name: aws-ebs-csi-driver.addons.k8s.io
    app.kubernetes.io/instance: aws-ebs-csi-driver
    app.kubernetes.io/managed-by: kops
    app.kubernetes.io/name: aws-ebs-csi-driver
    app.kubernetes.io/version: v1.8.0
    k8s-addon: aws-ebs-csi-driver.addons.k8s.io
  name: ebs-external-attacher-role
rules:
- apiGroups:
  - ""
  resources:
  - persistentvolumes
  verbs:
  - get
  - list
  - watch
  - update
  - patch
- apiGroups:
  - ""
  resources:
  - nodes
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - csi.storage.k8s.io
  resources:
  - csinodeinfos
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - storage.k8s.io
  resources:
  - volumeattachments
  verbs:
  - get
  - list
  - watch
  - update
  - patch
- apiGroups:
  - storage.k8s.io
  resources:
  - volumeattachments/status
  verbs:
  - patch

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  creationTimestamp: null
  labels:
    addon.kops.k8s.io/name: aws-ebs-csi-driver.addons.k8s.io
    app.kubernetes.io/instance: aws-ebs-csi-driver
    app.kubernetes.io/managed-by: kops
    app.kubernetes.io/name: aws-ebs-csi-driver
    app.kubernetes.io/version: v1.8.0
    k8s-addon: aws-ebs-csi-driver.addons.k8s.io
  name: ebs-external-provisioner-role
rules:
- apiGroups:
  - ""
  resources:
  - persistentvolumes
  verbs:
  - get
  - list
  - watch
  - create
  - delete
- apiGroups:
  - ""
  resources:
  - persistentvolumeclaims
  verbs:
  - get
  - list
  - watch
  - update
- apiGroups:
  - storage.k8s.io
  resources:
  - storageclasses
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - ""
  resources:
  - events
  verbs:
  - list
  - watch
  - create
  - update
  - patch
- apiGroups:
  - snapshot.storage.k8s.io
  resources:
  - volumesnapshots
  verbs:
  - get
  - list
- apiGroups:
  - snapshot.storage.k8s.io
  resources:
  - volumesnapshotcontents
  verbs:
  - get
  - list
- apiGroups:
  - storage.k8s.io
  resources:
  - csinodes
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - ""
  resources:
  - nodes
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - coordination.k8s.io
  resources:
  - leases
  verbs:
  - get
  - watch
  - list
  - delete
  - update
  - create
- apiGroups:
  - storage.k8s.io
  resources:
  - volumeattachments
  verbs:
  - get
  - list
  - watch

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  creationTimestamp: null
  labels:
    addon.kops.k8s.io/name: aws-ebs-csi-driver.addons.k8s.io
    app.kubernetes.io/instance: aws-ebs-csi-driver
    app.kubernetes.io/managed-by: kops
    app.kubernetes.io/name: aws-ebs-csi-driver
    app.kubernetes.io/version: v1.8.0
    k8s-addon: aws-ebs-csi-driver.addons.k8s.io
  name: ebs-external-resizer-role
rules:
- apiGroups:
  - ""
  resources:
  - persistentvolumes
  verbs:
  - get
  - list
  - watch
  - update
  - patch
- apiGroups:
  - ""
  resources:
  - persistentvolumeclaims
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - ""
  resources:
  - persistentvolumeclaims/status
  verbs:
  - update
  - patch
- apiGroups:
  - storage.k8s.io
  resources:
  - storageclasses
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - ""
  resources:
  - events
  verbs:
  - list
  - watch
  - create
  - update
  - patch
- apiGroups:
  - ""
  resources:
  - pods
  verbs:
  - get
  - list
  - watch

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  creationTimestamp: null
  labels:
    addon.kops.k8s.io/name: aws-ebs-csi-driver.addons.k8s.io
    app.kubernetes.io/instance: aws-ebs-csi-driver
    app.kubernetes.io/managed-by: kops
    app.kubernetes.io/name: aws-ebs-csi-driver
    app.kubernetes.io/version: v1.8.0
    k8s-addon: aws-ebs-csi-driver.addons.k8s.io
  name: ebs-external-snapshotter-role
rules:
- apiGroups:
  - ""
  resources:
  - events
  verbs:
  - list
  - watch
  - create
  - update
  - patch
- apiGroups:
  - ""
  resources:
  - secrets
  verbs:
  - get
  - list
- apiGroups:
  - snapshot.storage.k8s.io
  resources:
  - volumesnapshotclasses
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - snapshot.storage.k8s.io
  resources:
  - volumesnapshotcontents
  verbs:
  - create
  - get
  - list
  - watch
  - update
  - delete
  - patch
- apiGroups:
  - snapshot.storage.k8s.io
  resources:
  - volumesnapshotcontents/status
  verbs:
  - update

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  creationTimestamp: null
  labels:
    addon.kops.k8s.io/name: aws-ebs-csi-driver.addons.k8s.io
    app.kubernetes.io/instance: aws-ebs-csi-driver
    app.kubernetes.io/managed-by: kops
    app.kubernetes.io/name: aws-ebs-csi-driver
    app.kubernetes.io/version: v1.8.0
    k8s-addon: aws-ebs-csi-driver.addons.k8s.io
  name: ebs-csi-attacher-binding
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: ebs-external-attacher-role
subjects:
- kind: ServiceAccount
  name: ebs-csi-controller-sa
  namespace: kube-system

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  creationTimestamp: null
  labels:
    addon.kops.k8s.io/name: aws-ebs-csi-driver.addons.k8s.io
    app.kubernetes.io/instance: aws-ebs-csi-driver
    app.kubernetes.io/managed-by: kops
    app.kubernetes.io/name: aws-ebs-csi-driver
    app.kubernetes.io/version: v1.8.0
    k8s-addon: aws-ebs-csi-driver.addons.k8s.io
  name: ebs-csi-provisioner-binding
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: ebs-external-provisioner-role
subjects:
- kind: ServiceAccount
  name: ebs-csi-controller-sa
  namespace: kube-system

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  creationTimestamp: null
  labels:
    addon.kops.k8s.io/name: aws-ebs-csi-driver.addons.k8s.io
    app.kubernetes.io/instance: aws-ebs-csi-driver
    app.kubernetes.io/managed-by: kops
    app.kubernetes.io/name: aws-ebs-csi-driver
    app.kubernetes.io/version: v1.8.0
    k8s-addon: aws-ebs-csi-driver.addons.k8s.io
  name: ebs-csi-resizer-binding
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: ebs-external-resizer-role
subjects:
- kind: ServiceAccount
  name: ebs-csi-controller-sa
  namespace: kube-system

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  creationTimestamp: null
  labels:
    addon.kops.k8s.io/name: aws-ebs-csi-driver.addons.k8s.io
    app.kubernetes.io/instance: aws-ebs-csi-driver
    app.kubernetes.io/managed-by: kops
    app.kubernetes.io/name: aws-ebs-csi-driver
    app.kubernetes.io/version: v1.8.0
    k8s-addon: aws-ebs-csi-driver.addons.k8s.io
  name: ebs-csi-snapshotter-binding
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: ebs-external-snapshotter-role
subjects:
- kind: ServiceAccount
  name: ebs-csi-controller-sa
  namespace: kube-system

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  creationTimestamp: null
  labels:
    addon.kops.k8s.io/name: aws-ebs-csi-driver.addons.k8s.io
    app.kubernetes.io/managed-by: kops
    app.kubernetes.io/name: aws-ebs-csi-driver
    k8s-addon: aws-ebs-csi-driver.addons.k8s.io
  name: ebs-csi-node-getter-binding
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: ebs-csi-node-role
subjects:
- kind: ServiceAccount
  name: ebs-csi-node-sa
  namespace: kube-system

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  creationTimestamp: null
  labels:
    addon.kops.k8s.io/name: aws-ebs-csi-driver.addons.k8s.io
    app.kubernetes.io/managed-by: kops
    app.kubernetes.io/name: aws-ebs-csi-driver
    k8s-addon: aws-ebs-csi-driver.addons.k8s.io
  name: ebs-csi-node-role
rules:
- apiGroups:
  - ""
  resources:
  - nodes
  verbs:
  - get

---

apiVersion: v1
kind: ServiceAccount
metadata:
  creationTimestamp: null
  labels:
    addon.kops.k8s.io/name: aws-ebs-csi-driver.addons.k8s.io
    app.kubernetes.io/instance: aws-ebs-csi-driver
    app.kubernetes.io/managed-by: kops
    app.kubernetes.io/name: aws-ebs-csi-driver
    app.kubernetes.io/version: v1.8.0
    k8s-addon: aws-ebs-csi-driver.addons.k8s.io
  name: ebs-csi-node-sa
  namespace: kube-system

---

apiVersion: apps/v1
kind: DaemonSet
metadata:
  creationTimestamp: null
  labels:
    addon.kops.k8s.io/name: aws-ebs-csi-driver.addons.k8s.io
    app.kubernetes.io/instance: aws-ebs-csi-driver
    app.kubernetes.io/managed-by: kops
    app.kubernetes.io/name: aws-ebs-csi-driver
    app.kubernetes.io/version: v1.8.0
    k8s-addon: aws-ebs-csi-driver.addons.k8s.io
  name: ebs-csi-node
  namespace: kube-system
spec:
  selector:
    matchLabels:
      app: ebs-csi-node
      app.kubernetes.io/instance: aws-ebs-csi-driver
      app.kubernetes.io/name: aws-ebs-csi-driver
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: ebs-csi-node
        app.kubernetes.io/instance: aws-ebs-csi-driver
        app.kubernetes.io/name: aws-ebs-csi-driver
        app.kubernetes.io/version: v1.8.0
        kops.k8s.io/managed-by: kops
    spec:
      containers:
      - args:
        - node
        - --endpoint=$(CSI_ENDPOINT)
        - --logtostderr
        - --v=2
        env:
        - name: CSI_ENDPOINT
          value: unix:/csi/csi.sock
        - name: CSI_NODE_NAME
          valueFrom:
            fieldRef:
              fieldPath: spec.nodeName
        image: registry.k8s.io/provider-aws/aws-ebs-csi-driver:v1.8.0@sha256:2727c4ba96b420f6280107daaf4a40a5de5f7241a1b70052056a5016dff05b2f
        imagePullPolicy: IfNotPresent
        livenessProbe:
          failureThreshold: 5
          httpGet:
            path: /healthz
            port: healthz
          initialDelaySeconds: 10
          periodSeconds: 10
          timeoutSeconds: 3
        name: ebs-plugin
        ports:
        - containerPort: 9808
          name: healthz
          protocol: TCP
        securityContext:
          privileged: true
        volumeMounts:
        - mountPath: /var/lib/kubelet
          mountPropagation: Bidirectional
          name: kubelet-dir
        - mountPath: /csi
          name: plugin-dir
        - mountPath: /dev
          name: device-dir
      - args:
        - --csi-address=$(ADDRESS)
        - --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)
        - --v=5
        env:
        - name: ADDRESS
          value: /csi/csi.sock
        - name: DRIVER_REG_SOCK_PATH
          value: /var/lib/kubelet/plugins/ebs.csi.aws.com/csi.sock
        image: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.5.1@sha256:0103eee7c35e3e0b5cd8cdca9850dc71c793cdeb6669d8be7a89440da2d06ae4
        imagePullPolicy: IfNotPresent
        name: node-driver-registrar
        volumeMounts:
        - mountPath: /csi
          name: plugin-dir
        - mountPath: /registration
          name: registration-dir
      - args:
        - --csi-address=/csi/csi.sock
        image: registry.k8s.io/sig-storage/livenessprobe:v2.5.0@sha256:44d8275b3f145bc290fd57cb00de2d713b5e72d2e827d8c5555f8ddb40bf3f02
        imagePullPolicy: IfNotPresent
        name: liveness-probe
        volumeMounts:
        - mountPath: /csi
          name: plugin-dir
      nodeSelector:
        kubernetes.io/os: linux
      priorityClassName: system-node-critical
      serviceAccountName: ebs-csi-node-sa
      tolerations:
      - operator: Exists
      volumes:
      - hostPath:
          path: /var/lib/kubelet
          type: Directory
        name: kubelet-dir
      - hostPath:
          path: /var/lib/kubelet/plugins/ebs.csi.aws.com/
          type: DirectoryOrCreate
        name: plugin-dir
      - hostPath:
          path: /var/lib/kubelet/plugins_registry/
          type: Directory
        name: registration-dir
      - hostPath:
          path: /dev
          type: Directory
        name: device-dir

---

apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    addon.kops.k8s.io/name: aws-ebs-csi-driver.addons.k8s.io
    app.kubernetes.io/instance: aws-ebs-csi-driver
    app.kubernetes.io/managed-by: kops
    app.kubernetes.io/name: aws-ebs-csi-driver
    app.kubernetes.io/version: v1.8.0
    k8s-addon: aws-ebs-csi-driver.addons.k8s.io
  name: ebs-csi-controller
  namespace: kube-system
spec:
  replicas: 2
  selector:
    matchLabels:
      app: ebs-csi-controller
      app.kubernetes.io/instance: aws-ebs-csi-driver
      app.kubernetes.io/name: aws-ebs-csi-driver
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: ebs-csi-controller
        app.kubernetes.io/instance: aws-ebs-csi-driver
        app.kubernetes.io/name: aws-ebs-csi-driver
        app.kubernetes.io/version: v1.8.0
        kops.k8s.io/managed-by: kops
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: node-role.kubernetes.io/control-plane
                operator: Exists
              - key: kubernetes.io/os
                operator: In
                values:
                - linux
            - matchExpressions:
              - key: node-role.kubernetes.io/master
                operator: Exists
              - key: kubernetes.io/os
                operator: In
                values:
                - linux
      containers:
      - args:
        - controller
        - --endpoint=$(CSI_ENDPOINT)
        - --logtostderr
        - --k8s-tag-cluster-id=dev.datasaker.io
        - --extra-tags=KubernetesCluster=dev.datasaker.io
        - --v=5
        env:
        - name: CSI_ENDPOINT
          value: unix:///var/lib/csi/sockets/pluginproxy/csi.sock
        - name: CSI_NODE_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: spec.nodeName
        - name: AWS_ACCESS_KEY_ID
          valueFrom:
            secretKeyRef:
              key: key_id
              name: aws-secret
              optional: true
        - name: AWS_SECRET_ACCESS_KEY
          valueFrom:
            secretKeyRef:
              key: access_key
              name: aws-secret
              optional: true
        image: registry.k8s.io/provider-aws/aws-ebs-csi-driver:v1.8.0@sha256:2727c4ba96b420f6280107daaf4a40a5de5f7241a1b70052056a5016dff05b2f
        imagePullPolicy: IfNotPresent
        livenessProbe:
          failureThreshold: 5
          httpGet:
            path: /healthz
            port: healthz
          initialDelaySeconds: 10
          periodSeconds: 10
          timeoutSeconds: 3
        name: ebs-plugin
        ports:
        - containerPort: 9808
          name: healthz
          protocol: TCP
        readinessProbe:
          failureThreshold: 5
          httpGet:
            path: /healthz
            port: healthz
          initialDelaySeconds: 10
          periodSeconds: 10
          timeoutSeconds: 3
        volumeMounts:
        - mountPath: /var/lib/csi/sockets/pluginproxy/
          name: socket-dir
      - args:
        - --csi-address=$(ADDRESS)
        - --v=5
        - --feature-gates=Topology=true
        - --extra-create-metadata
        - --leader-election=true
        - --default-fstype=ext4
        env:
        - name: ADDRESS
          value: /var/lib/csi/sockets/pluginproxy/csi.sock
        image: registry.k8s.io/sig-storage/csi-provisioner:v3.1.0@sha256:122bfb8c1edabb3c0edd63f06523e6940d958d19b3957dc7b1d6f81e9f1f6119
        imagePullPolicy: IfNotPresent
        name: csi-provisioner
        volumeMounts:
        - mountPath: /var/lib/csi/sockets/pluginproxy/
          name: socket-dir
      - args:
        - --csi-address=$(ADDRESS)
        - --v=5
        - --leader-election=true
        env:
        - name: ADDRESS
          value: /var/lib/csi/sockets/pluginproxy/csi.sock
        image: registry.k8s.io/sig-storage/csi-attacher:v3.4.0@sha256:8b9c313c05f54fb04f8d430896f5f5904b6cb157df261501b29adc04d2b2dc7b
        imagePullPolicy: IfNotPresent
        name: csi-attacher
        volumeMounts:
        - mountPath: /var/lib/csi/sockets/pluginproxy/
          name: socket-dir
      - args:
        - --csi-address=$(ADDRESS)
        - --v=5
        env:
        - name: ADDRESS
          value: /var/lib/csi/sockets/pluginproxy/csi.sock
        image: registry.k8s.io/sig-storage/csi-resizer:v1.4.0@sha256:9ebbf9f023e7b41ccee3d52afe39a89e3ddacdbb69269d583abfc25847cfd9e4
        imagePullPolicy: IfNotPresent
        name: csi-resizer
        volumeMounts:
        - mountPath: /var/lib/csi/sockets/pluginproxy/
          name: socket-dir
      - args:
        - --csi-address=/csi/csi.sock
        image: registry.k8s.io/sig-storage/livenessprobe:v2.5.0@sha256:44d8275b3f145bc290fd57cb00de2d713b5e72d2e827d8c5555f8ddb40bf3f02
        imagePullPolicy: IfNotPresent
        name: liveness-probe
        volumeMounts:
        - mountPath: /csi
          name: socket-dir
      nodeSelector: null
      priorityClassName: system-cluster-critical
      serviceAccountName: ebs-csi-controller-sa
      tolerations:
      - operator: Exists
      topologySpreadConstraints:
      - labelSelector:
          matchLabels:
            app: ebs-csi-controller
            app.kubernetes.io/instance: aws-ebs-csi-driver
            app.kubernetes.io/name: aws-ebs-csi-driver
        maxSkew: 1
        topologyKey: topology.kubernetes.io/zone
        whenUnsatisfiable: ScheduleAnyway
      - labelSelector:
          matchLabels:
            app: ebs-csi-controller
            app.kubernetes.io/instance: aws-ebs-csi-driver
            app.kubernetes.io/name: aws-ebs-csi-driver
        maxSkew: 1
        topologyKey: kubernetes.io/hostname
        whenUnsatisfiable: DoNotSchedule
      volumes:
      - emptyDir: {}
        name: socket-dir

---

apiVersion: storage.k8s.io/v1
kind: CSIDriver
metadata:
  creationTimestamp: null
  labels:
    addon.kops.k8s.io/name: aws-ebs-csi-driver.addons.k8s.io
    app.kubernetes.io/instance: aws-ebs-csi-driver
    app.kubernetes.io/managed-by: kops
    app.kubernetes.io/name: aws-ebs-csi-driver
    app.kubernetes.io/version: v1.8.0
    k8s-addon: aws-ebs-csi-driver.addons.k8s.io
  name: ebs.csi.aws.com
spec:
  attachRequired: true
  podInfoOnMount: false

---

apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  creationTimestamp: null
  labels:
    addon.kops.k8s.io/name: aws-ebs-csi-driver.addons.k8s.io
    app.kubernetes.io/instance: aws-ebs-csi-driver
    app.kubernetes.io/managed-by: kops
    app.kubernetes.io/name: aws-ebs-csi-driver
    app.kubernetes.io/version: v1.8.0
    k8s-addon: aws-ebs-csi-driver.addons.k8s.io
  name: ebs-csi-controller
  namespace: kube-system
spec:
  maxUnavailable: 1
  selector:
    matchLabels:
      app: ebs-csi-controller
      app.kubernetes.io/instance: aws-ebs-csi-driver