apiVersion: apps/v1
kind: Deployment
metadata:
  name: config-manager
  # namespace: infra
spec:
  replicas: 2
  selector:
    matchLabels:
      app: config-manager
  strategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: config-manager
    spec:
      containers:
      - args:
        - --leader-elect
        - --zap-devel
        - --activity
        - --activity-config=/etc/conifg-manager/activity.yaml
        - "false"
        command:
        - /manager
        env:
        - name: KUBECONFIG
          value: /.kube/config
        image: gcr.io/pingcap-public/config-manager:99b54ee6b73f5a6217992fee6a31756b270df844
        imagePullPolicy: IfNotPresent
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /healthz
            port: 8081
            scheme: HTTP
          initialDelaySeconds: 15
          periodSeconds: 20
          successThreshold: 1
          timeoutSeconds: 1
        name: manager
        ports:
        - containerPort: 9443
          name: webhook-server
          protocol: TCP
        readinessProbe:
          failureThreshold: 10
          httpGet:
            path: /readyz
            port: 8081
            scheme: HTTP
          initialDelaySeconds: 5
          periodSeconds: 5
          successThreshold: 1
          timeoutSeconds: 1
        resources:
          limits:
            cpu: "2"
            memory: 2Gi
          requests:
            cpu: 100m
            memory: 100Mi
        volumeMounts:
        - mountPath: /.kube
          name: kubeconfig
        - mountPath: /tmp/k8s-webhook-server/serving-certs
          name: cert
        - name: activity-config
          mountPath: /etc/conifg-manager
      serviceAccountName: config-manager
      volumes:
      - name: kubeconfig
        secret:
          secretName: api-server-kubeconfig
      - name: cert
        secret:
          secretName: infra-webhook-cert
      - name: activity-config
        configMap:
          name: config-manager-activity-config
