Hello everyone, I am running Prefect 2.20 on a Kub...
# ask-community
d
Hello everyone, I am running Prefect 2.20 on a Kubernete Cluster with restricted Pod Security enabled. When running a deployment the Kubernetes Job started gets a 403 Error in it's logs:
Copy code
prefect.exceptions.PrefectHTTPStatusError: Client error '403 Forbidden' for url '<http://prefect-server.dev.svc.cluster.local:4200/api/flow_runs/9633e270-1c72-44e3-969e-19e2ec7b7d24>'
This (to my understanding) happens when the runner wants to read his own data from the server:
Copy code
File "/usr/local/lib/python3.10/site-packages/prefect/runner/runner.py", line 481, in execute_flow_run
    flow_run = await self._client.read_flow_run(flow_run_id)
  File "/usr/local/lib/python3.10/site-packages/prefect/client/orchestration.py", line 2013, in read_flow_run
    response = await self._client.get(f"/flow_runs/{flow_run_id}")
I am setting appropriate Service Accounts and Role Bindings. Creating a job manually and calling curl on that URL gives the desired answer of the API. Does anyone have a tip what might be the issue here? Is there anything I have to consider when building the Docker Images containing the Flow code if they are run i a restricted environment? Thanks in advance