https://prefect.io logo
Title
m

Marius Vollmer

04/28/2023, 1:55 PM
Hi everyone, I am getting the following error, but Finished Job Ttl is configured in Kubernetes Job block (tried via Finished Job Ttl input box and via Base Job Manifest). Log
Submission failed. kubernetes.client.exceptions.ApiException: (403) Reason: Forbidden HTTP response headers: HTTPHeaderDict({'Audit-Id': '8dafec7b-865c-4190-9ff8-2c6859310d44', 'Cache-Control': 'no-cache, private', 'Content-Type': 'application/json', 'X-Kubernetes-Pf-Flowschema-Uid': '271f18eb-a208-418a-b558-589f2b1931ce', 'X-Kubernetes-Pf-Prioritylevel-Uid': '666d5261-3a03-4c64-b623-ed6529882f73', 'Date': 'Fri,
    28 Apr 2023 13: 47: 23 GMT', 'Content-Length': '332'
}) HTTP response body: {
    "kind": "Status",
    "apiVersion": "v1",
    "metadata": {},
    "status": "Failure",
    "message": "admission webhook \"validation.gatekeeper.sh\" denied the request: [job-ttl-after-finished-v2] Job does not have ttlSecondsAfterFinished configured",
    "reason": "[job-ttl-after-finished-v2] Job does not have ttlSecondsAfterFinished configured",
    "code": 403
}
Base Job Manifest
{
  "apiVersion": "batch/v1",
  "kind": "Job",
  "metadata": {
    "labels": {}
  },
  "spec": {
    "ttlSecondsAfterFinished": 120,
    "template": {
      "spec": {
        "serviceAccountName": "prefect-agent",
        "completions": 1,
        "containers": [
          {
            "env": [],
            "name": "prefect-job"
          }
        ],
        "parallelism": 1,
        "restartPolicy": "Never"
      }
    }
  }
}
Can anyone help me here? Thanks in advance!
z

Zanie

04/28/2023, 2:18 PM
Hm we might remove this field even if it's in the base manifest because we have a dedicated setting for it
If the field is null we likely presume it was intended not to be set
m

Marius Vollmer

04/28/2023, 2:21 PM
So do I have to put Finished Job Ttl in a completely different place?
z

Zanie

04/28/2023, 2:24 PM
You said you tried it in the input box too? That's where I imagine you'd need to set it.
m

Marius Vollmer

04/28/2023, 2:26 PM
Yes, set it like this
z

Zanie

04/28/2023, 2:57 PM
Hm if it was not attached when doing that it sounds like. a bug