Marko Jamedzija
05/31/2021, 1:30 PMKubernetesRun
so that it runs jobs in a different namespace than the agent is in. I tried setting the namespace in job template yaml, but it doesn’t work. Any suggestions?ERROR:agent:Error while deploying flow
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/prefect/agent/agent.py", line 420, in deploy_and_update_flow_run
deployment_info = self.deploy_flow(flow_run)
File "/usr/local/lib/python3.7/site-packages/prefect/agent/kubernetes/agent.py", line 410, in deploy_flow
namespace=self.namespace, body=job_spec
File "/usr/local/lib/python3.7/site-packages/kubernetes/client/api/batch_v1_api.py", line 58, in create_namespaced_job
(data) = self.create_namespaced_job_with_http_info(namespace, body, **kwargs) # noqa: E501
File "/usr/local/lib/python3.7/site-packages/kubernetes/client/api/batch_v1_api.py", line 149, in create_namespaced_job_with_http_info
collection_formats=collection_formats)
File "/usr/local/lib/python3.7/site-packages/kubernetes/client/api_client.py", line 335, in call_api
_preload_content, _request_timeout)
File "/usr/local/lib/python3.7/site-packages/kubernetes/client/api_client.py", line 166, in __call_api
_request_timeout=_request_timeout)
File "/usr/local/lib/python3.7/site-packages/kubernetes/client/api_client.py", line 378, in request
body=body)
File "/usr/local/lib/python3.7/site-packages/kubernetes/client/rest.py", line 278, in POST
body=body)
File "/usr/local/lib/python3.7/site-packages/kubernetes/client/rest.py", line 231, in request
raise ApiException(http_resp=r)
kubernetes.client.rest.ApiException: (400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Audit-Id': '<some-id>', 'Cache-Control': 'no-cache, private', 'Content-Type': 'application/json', 'Date': 'Mon, 31 May 2021 13:10:46 GMT', 'Content-Length': '200'})
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"the namespace of the provided object does not match the namespace sent on the request","reason":"BadRequest","code":400}
--namespace <some-namespace>
but the current helm chart I’m using it doesn’t have that option integrated and I don’t want to have my custom overrideKevin Kho
Marko Jamedzija
05/31/2021, 3:42 PMTyler Wanner
06/02/2021, 4:12 AM--namespace
to set both the agent's namespace and its NAMESPACE env var, but you could alter the output of install
to set a different NAMESPACE env var. I wouldn't suggest trying to set namespace in job templates, but would welcome an issue if you have an experience in mind.Marko Jamedzija
06/02/2021, 9:35 AMKubernetesRun
)? E.g. I have one agent and I want it to run some flows in one namespace and some in the other.Tyler Wanner
06/02/2021, 1:28 PMMarko Jamedzija
06/02/2021, 1:41 PM