apiVersion: batch/v1
kind: Job
metadata:
  name:  varnish-operator-webhooks-cert-gen
  annotations:
    "helm.sh/hook": pre-install,pre-upgrade
    "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
    "helm.sh/hook-weight": "3"
spec:
  ttlSecondsAfterFinished: 0
  template:
    metadata:
      name:  varnish-operator-webhooks-cert-gen
      labels:
        app: varnish-operator-webhooks-cert-gen
    spec:
      containers:
        - name: create
          image: jettech/kube-webhook-certgen:v1.0.0
          imagePullPolicy: Always
          args:
            - create
            - --host=varnish-operator-service.{{ .Release.Namespace }}.svc
            - --namespace={{ .Release.Namespace }}
            - --secret-name=varnish-operator-webhook-server-cert
      restartPolicy: OnFailure
      serviceAccountName: varnish-operator-webhooks-cert-patch
