apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
  name: "cronjob-name-labels-admission-webhook.default.svc"
webhooks:
- name: "cronjob-name-labels-admission-webhook.default.svc"
  failurePolicy: Ignore
  rules:
  - apiGroups:   ["batch"]
    apiVersions: ["v1"]
    operations:  ["CREATE"]
    resources:   ["jobs"]
    scope:       "Namespaced"
  clientConfig:
    service:
      namespace: "default"
      name: "cronjob-name-labels-admission-webhook"
      path: "/label-job-owned-by-cronjob"
      port: 443
    # Replace CA_BUNDLE with "$(kubectl get secret tls-secret -o jsonpath='{.data.tls\.crt}')"
    caBundle: "CA_BUNDLE"
  admissionReviewVersions: ["v1", "v1beta1"]
  sideEffects: None
  timeoutSeconds: 5