---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/instance: external-secrets
    app.kubernetes.io/name: external-secrets-webhook
    app.kubernetes.io/version: v0.15.1
  name: external-secrets-webhook
  namespace: external-secrets
spec:
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app.kubernetes.io/instance: external-secrets
      app.kubernetes.io/name: external-secrets-webhook
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: external-secrets
        app.kubernetes.io/name: external-secrets-webhook
        app.kubernetes.io/version: v0.15.1
    spec:
      automountServiceAccountToken: true
      containers:
        - args:
            - webhook
            - --port=10250
            - --dns-name=external-secrets-webhook.external-secrets.svc
            - --cert-dir=/tmp/certs
            - --check-interval=5m
            - --metrics-addr=:8080
            - --healthz-addr=:8081
            - --loglevel=info
            - --zap-time-encoding=epoch
          image: oci.external-secrets.io/external-secrets/external-secrets:v0.15.1
          imagePullPolicy: IfNotPresent
          name: webhook
          ports:
            - containerPort: 8080
              name: metrics
              protocol: TCP
            - containerPort: 10250
              name: webhook
              protocol: TCP
          readinessProbe:
            httpGet:
              path: /readyz
              port: 8081
            initialDelaySeconds: 20
            periodSeconds: 5
          securityContext:
            allowPrivilegeEscalation: false
            capabilities:
              drop:
                - ALL
            readOnlyRootFilesystem: true
            runAsNonRoot: true
            runAsUser: 1000
            seccompProfile:
              type: RuntimeDefault
          volumeMounts:
            - mountPath: /tmp/certs
              name: certs
              readOnly: true
      hostNetwork: false
      serviceAccountName: external-secrets-webhook
      volumes:
        - name: certs
          secret:
            secretName: external-secrets-webhook
