apiVersion: batch/v1
kind: Job
metadata:
  name: cert-manager-startupapicheck
  namespace: cert-manager
  labels:
    app: startupapicheck
    app.kubernetes.io/name: startupapicheck
    app.kubernetes.io/instance: cert-manager
    app.kubernetes.io/component: "startupapicheck"
    app.kubernetes.io/version: "v1.19.2"
    app.kubernetes.io/managed-by: Helm
    helm.sh/chart: cert-manager-v1.19.2
  annotations:
    helm.sh/hook: post-install
    helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded
    helm.sh/hook-weight: "1"
spec:
  backoffLimit: 4
  template:
    metadata:
      labels:
        app: startupapicheck
        app.kubernetes.io/name: startupapicheck
        app.kubernetes.io/instance: cert-manager
        app.kubernetes.io/component: "startupapicheck"
        app.kubernetes.io/version: "v1.19.2"
        app.kubernetes.io/managed-by: Helm
        helm.sh/chart: cert-manager-v1.19.2
    spec:
      restartPolicy: OnFailure
      serviceAccountName: cert-manager-startupapicheck
      enableServiceLinks: false
      securityContext:
        runAsNonRoot: true
        seccompProfile:
          type: RuntimeDefault
      containers:
        - name: cert-manager-startupapicheck
          image: "quay.io/jetstack/cert-manager-startupapicheck:v1.19.2"
          imagePullPolicy: IfNotPresent
          args:
            - check
            - api
            - --wait=1m
            - -v
          securityContext:
            allowPrivilegeEscalation: false
            capabilities:
              drop:
                - ALL
            readOnlyRootFilesystem: true
          env:
            - name: POD_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
      nodeSelector:
        kubernetes.io/os: "linux"
