Hi what is the best way to deal with different env...
# prefect-kubernetes
y
Hi what is the best way to deal with different environment requirement jobs (different packages that is needed) • I have tried to create another workpool and tried to create anotehr work to work with it, but doesnt allow me to deploy
prefect/prefect-worker
helm chart twice (I have anotehr worker running already) Wondering if there is a way to specify the image according to prefect flows/tagged attached in the base job template?
1
j
you can set job overrides at the deployment level. in your prefect.yaml deployment config:
Copy code
deployments:
  - name: my=deployment
    ...    
    work_pool:
      name: my-workpool
      job_variables:
        namespace: my-namespace
        service_account_name: my-service-account
you can also deploy more than 1 worker! if you are trying to do so within the same namespace, you’ll have to configure the second worker with a
fullnameOverride
to ensure all the k8s resources will be unique
y
is there anything i need to do if i want to pull from a private ecr image in the overwrite in
prefect.yaml
? so far i didnt need to do anything in base job template. When i tried to specify it directly like this:
Copy code
work_pool:
    name: k8
    work_queue_name:
    job_variables:
      image: "xxxx.dkr.ecr.eu-central-1.amazonaws.com/data/prefect-agent-ml:latest"
the pod could not start at all
Copy code
Worker 'KubernetesWorker dfb2ba55-01ee-489b-b233-5d9afb4cc07f' submitting flow run 'f6359f84-1fa9-400f-a91a-b85c61e89217'
06:37:13 PM
prefect.flow_runs.worker
Creating Kubernetes job...
06:37:13 PM
prefect.flow_runs.worker
Completed submission of flow run 'f6359f84-1fa9-400f-a91a-b85c61e89217'
06:37:13 PM
prefect.flow_runs.worker
Job 'lambda730-forlindon-55p5q': Pod has status 'Pending'.
06:37:13 PM
prefect.flow_runs.worker
Job 'lambda730-forlindon-55p5q': Pod never started.
06:38:13 PM
prefect.flow_runs.worker
Pod event 'Scheduled' at 2023-10-23 10:37:13+00:00: Successfully assigned data/lambda730-forlindon-55p5q-nb6jp to ip-x.eu-central-1.compute.internal
06:38:13 PM
prefect.flow_runs.worker
Job event 'Injected' at 2023-10-23 10:37:13+00:00: Linkerd sidecar proxy injected
06:38:13 PM
prefect.flow_runs.worker
Job event 'SuccessfulCreate' at 2023-10-23 10:37:13+00:00: Created pod: lambda730-forlindon-55p5q-nb6jp
06:38:13 PM
prefect.flow_runs.worker
Pod event 'Pulled' at 2023-10-23 10:37:14+00:00: Container image "cr.l5d.io/linkerd/proxy-init:v2.2.1" already present on machine
06:38:13 PM
prefect.flow_runs.worker
Pod event 'Created' at 2023-10-23 10:37:14+00:00: Created container linkerd-init
06:38:13 PM
prefect.flow_runs.worker
Pod event 'Started' at 2023-10-23 10:37:14+00:00: Started container linkerd-init
06:38:13 PM
prefect.flow_runs.worker
Pod event 'Pulled' at 2023-10-23 10:37:15+00:00: Container image "cr.l5d.io/linkerd/proxy:stable-2.13.6" already present on machine
06:38:13 PM
prefect.flow_runs.worker
Pod event 'Created' at 2023-10-23 10:37:15+00:00: Created container linkerd-proxy
06:38:13 PM
prefect.flow_runs.worker
Pod event 'Started' at 2023-10-23 10:37:15+00:00: Started container linkerd-proxy
06:38:13 PM
prefect.flow_runs.worker
Pod event 'Pulling' at 2023-10-23 10:37:15+00:00: Pulling image "xx"
06:38:13 PM
prefect.flow_runs.worker
Reported flow run 'f6359f84-1fa9-400f-a91a-b85c61e89217' as crashed: Flow run infrastructure exited with non-zero status code -1.
j
you’ll need to make sure that wherever your worker is running has the appropriate permissions to access the private registry
so if running in k8s, you worker pod will need access to the ecr registry
y
is the auth in the base job template and the overwrite the same? because specifying it in the workpool dont have any issue