apiVersion: apps/v1
kind: Deployment
metadata:
  name: certmanager-webhook
  namespace: "{{.NameSpace}}"
  labels:
    app: alameda
    component: certmanager-webhook
spec:
  replicas: 1
  selector:
    matchLabels:
      app: alameda
      component: certmanager-webhook
  template:
    metadata:
      labels:
        app: alameda
        component: certmanager-webhook
    spec:
      serviceAccountName: certmanager-webhook
      containers:
        - name: webhook
          image: "quay.io/jetstack/cert-manager-webhook:v0.9.1"
          imagePullPolicy: IfNotPresent
          args:
          - --v=2
          - --secure-port=6443
          - --tls-cert-file=/certs/tls.crt
          - --tls-private-key-file=/certs/tls.key
          env:
          - name: POD_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          volumeMounts:
          - name: certs
            mountPath: /certs
      volumes:
      - name: certs
        secret:
          secretName: certmanager-webhook-webhook-tls
