---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: snapshot-controller
  namespace: rook-ceph
spec:
  replicas: 3
  selector:
    matchLabels:
      app.kubernetes.io/name: snapshot-controller
  minReadySeconds: 15
  strategy:
    rollingUpdate:
      maxSurge: 0
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        app.kubernetes.io/name: snapshot-controller
    spec:
      serviceAccount: snapshot-controller
      containers:
        - name: snapshot-controller
          image: k8s.gcr.io/sig-storage/snapshot-controller:v6.0.1
          imagePullPolicy: IfNotPresent
          args:
            - "--v=5"
            - "--leader-election=true"
      topologySpreadConstraints:
        - maxSkew: 1
          topologyKey: kubernetes.io/hostname
          whenUnsatisfiable: DoNotSchedule
          labelSelector:
            matchLabels:
              app.kubernetes.io/name: snapshot-controller
