Hi there, I’m confused about how to deployments wi...
# ask-community
n
Hi there, I’m confused about how to deployments with a custom image. I have a Prefect Worker running on my Kubernetes cluster. Here is the
deployment.yaml
for my project:
Copy code
deployments:
- name: my-kubernetes
  version: "0.0.1"
  entrypoint: demo.py:run_demo_prefect
  infrastructure:
    type: kubernetes-job
    image: "docker-repository-url/image-name:tag"
  work_pool:
    name: default
    work_queue_name: default
The worker correctly runs the deployment in a new Kubernetes Job, yet using the default Prefect image instead of the one I have specified. What I’m missing?
1
a
Hey Nicholas! It looks like you’re specifying the custom image name under
infrastructure
that the prefect deploy command does not recognize. Instead, you can specify your custom image under
work_pool
like so:
Copy code
work_pool:
  name: default
  work_queue_name: default
  job_variables:
    image: "docker-repository-url/image-name:tag"
If you’re using the
build_docker_image
step you can use the output from that step to automatically populate that field like this:
Copy code
work_pool:
  name: default
  work_queue_name: default
  job_variables:
    image: "{{ image_name }}"
🙌 1
n
Cool, it works! Thank you very much
🎉 1