apiVersion: apps/v1
kind: Deployment
metadata:
  name: webhook-server
spec:
  replicas: 1
  selector:
    matchLabels:
      app: webhook-server
  template:
    metadata:
      labels:
        app: webhook-server
    spec:
      containers:
        - name: server
          command:
            - /webhook
          args:
            - --zap-devel
            - "false"
          env:
            - name: AWS_DEFAULT_REGION
              value: us-west-2
            - name: AWS_REGION
              value: us-west-2
          image: IMAGE_REGISTRY/tidbcloud/infra-webhook:64ea7880bd46b483dfb6d80043ea4772325a0b26
          imagePullPolicy: IfNotPresent
          resources:
            limits:
              cpu: 500m
              memory: 500Mi
            requests:
              cpu: 100m
              memory: 100Mi
          livenessProbe:
            failureThreshold: 3
            httpGet:
              path: /healthz
              port: 8081
              scheme: HTTP
            initialDelaySeconds: 15
            periodSeconds: 20
            successThreshold: 1
            timeoutSeconds: 1
          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
          volumeMounts:
            - mountPath: /tmp/k8s-webhook-server/serving-certs
              name: cert
      serviceAccount: webhook-server
      serviceAccountName: webhook-server
      volumes:
        - name: cert
          secret:
            defaultMode: 420
            secretName: webhook-server-cert
