Hi everyone, I am getting the following error, but...
# prefect-community
m
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
Copy code
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
Copy code
{
  "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
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
So do I have to put Finished Job Ttl in a completely different place?
z
You said you tried it in the input box too? That's where I imagine you'd need to set it.
m
Yes, set it like this
z
Hm if it was not attached when doing that it sounds like. a bug