---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: controller-manager-webhook
  namespace: system
  labels:
    control-plane: submariner-operator
  annotations:
    seccomp.security.alpha.kubernetes.io/pod: runtime/default
spec:
  selector:
    matchLabels:
      control-plane: submariner-operator
  replicas: 1
  template:
    metadata:
      labels:
        control-plane: submariner-operator
    spec:
      containers:
        - command:
            - /webhook
          # uncomment the following section to update the respective parameters.
          # args:
          # - --allowed-external-ip-cidrs=10.0.0.0/8,11.0.0.0/8
          # - --webhook-port=9443
          # - --metrics-addr=0.0.0.0:8443
          image: webhook:latest
          name: webhook
          ports:
            - containerPort: 9443
              name: webhook-server
              protocol: TCP
          # - containerPort: 8443
          #  name: webhook-metrics
          volumeMounts:
            - mountPath: /tmp/k8s-webhook-server/serving-certs
              name: cert
              readOnly: true
          resources:
            limits:
              cpu: 100m
              memory: 30Mi
            requests:
              cpu: 100m
              memory: 20Mi
      volumes:
        - name: cert
          secret:
            defaultMode: 420
            secretName: webhook-server-cert
      terminationGracePeriodSeconds: 10
