Mike Kovetsky
08/04/2022, 4:40 PMprefect kubernetes manifest orion
to k8s_deployment.yaml
(please add the ability to set non-default k8s namespace)
• change PREFECT_API_URL from http://orion:4200/api to http://0.0.0.0:4200/api
• kubectl apply -f k8s_deployment.yaml
(it already has command: [“prefect”, “orion”, “start”, “--host”, “0.0.0.0”, “--log-level”, “WARNING”] for API container)
• check the GCP admin. The agent/ui/api seems to be healthy.
• kubectl port-forward deployment/orion 4200:4200
• check the UI is healthy via http://127.0.0.1:4200/.
• prefect config set PREFECT_API_URL=<http://0.0.0.0:4200/api>
• register GCS block via admin panel. name=prefect. path: gs://{my-path}. (prefect block register -f gcs_block.py didn’t work for me for some reason)
• prefect deployment build ../flows/backtest.py:backtest_flow --name dev --tag dev --infra kubernetes-job --storage-block gcs/prefect
(should i run it from root of the project?)
• checked my GCS bucket. The files did appear in the local folder and GCS.
• prefect deployment apply backtest_flow-deployment.yaml
• check UI http://127.0.0.1:4200/deployments. deployment did appear
• create kubernetes
queue manually. The name seems to be hardcoded according to the error logs in GCP agent. This step fixes the error.
• prefect deployment run Backtest/dev
• the flow run was created. But it is stuck in pending.
• The appropriate KubernetesJob was created. But it is stuck in error state with the error All connection attempts failed. and ConnectionRefusedError: [Errno 111] Connect call failed (‘0.0.0.0’, 4200).
Please help! Thank you in advance :)Anna Geller
prefect config set PREFECT_API_URL=<http://localhost:4200/api>
Mike Kovetsky
08/04/2022, 10:31 PMDominik Wagner
08/05/2022, 7:12 AM(please add the ability to set non-default k8s namespace)You can manually edit the .yaml to use a non-default namespace, wherever you have a block (where you find apiVersion and kind), either change or add metadata/namespace:
apiVersion: <...>
kind: <...>
metadata:
namespace: prefect
Mike Kovetsky
08/05/2022, 7:27 AMDominik Wagner
08/05/2022, 7:31 AMAnna Geller
Mike Kovetsky
08/05/2022, 11:36 AMprefect config set PREFECT_API_URL=<http://localhost:4200/api>
may have been overwritten by the env variable value inside the deployment spec. I’ll redeploy with localhost and come back 🙂Anna Geller