---
kind: Deployment
apiVersion: apps/v1
metadata:
  name: csi-snapshot-controller
  namespace: kube-system
spec:
  replicas: 2
  selector:
    matchLabels:
      app: csi-snapshot-controller
  template:
    metadata:
      labels:
        app: csi-snapshot-controller
    spec:
      serviceAccountName: csi-snapshot-controller-sa
      nodeSelector:
        kubernetes.io/os: linux
      priorityClassName: system-cluster-critical
      tolerations:
        - key: "node-role.kubernetes.io/master"
          operator: "Equal"
          value: "true"
          effect: "NoSchedule"
        - key: "node-role.kubernetes.io/controlplane"
          operator: "Equal"
          value: "true"
          effect: "NoSchedule"
      containers:
        - name: csi-snapshot-controller
          image: mcr.microsoft.com/oss/kubernetes-csi/snapshot-controller:v5.0.1
          args:
            - "--v=2"
            - "--leader-election=true"
          resources:
            limits:
              memory: 100Mi
            requests:
              cpu: 10m
              memory: 20Mi
