Closed szymi- closed 7 months ago
Hello, there are a couple options to avoid this issue. The first is to use updateImageTags: false. This will prevent DevSpace from attempting to rewrite image references that don't have tags. Here's a sample that worked for my testing:
deployments:
airflow:
updateImageTags: false
helm:
chart:
repo: https://airflow.apache.org
name: airflow
values:
images:
airflow:
repository: custom/apache-airflow
tag: latest
The other option is to use DevSpace's ${runtime.variables} to be a little more explicit about what DevSpace should substitute (if you want anything substituted at all). These are more likely to be useful if you're using DevSpace's dynamic tags. Here's an example that also worked for me:
deployments:
airflow:
updateImageTags: false
helm:
chart:
repo: https://airflow.apache.org
name: airflow
values:
images:
airflow:
repository: ${runtime.images.custom-airflow.image}
tag: ${runtime.images.custom-airflow.tag}
The first option is likely the better fit for your case, but the second could be helpful if using the latest
tag causes issues with images not re-pulling in your environment.
Hope this helps!
Thanks for your time. I went with the second option as I have a feeling it will save me (or a teammate) some unnecessary troubles in the future. It works :)
Hey @szymi- I'm glad Russ's suggestions unblocked your use case.
Closing this issue for now then, please feel free to re-open it if you're still facing similar issues!
What happened?
I am trying to develop a custom airflow image (including development of some cusotm python packages - that's why I need devspace.sh) using airflow helm charts in local kubernetes on my laptop (I am using Ubuntu in WSL + kind as my kubernetes cluster). I am able to use the default airflow image successfully and trigger file synchronization into the airflow containers, but I would like to replace the image from helm charts with my custom image (it has some python dependencies installed needed for development, which are not present in the default container). I am unable to replace the image in helm charts - no matter how I try, I get
Init:InvalidImageName
from kubernetes:When I inspect the pods to see what images are being used, I get images with double
latest:latest
tag as follows (or double tags likelatest:2.7.1
etc, in other combinations), no matter what I try:I tried adding registry url to the image deffinition, like
localhost:5001
orkind-registry:5000
but the tags were always double.What did you expect to happen instead?
The images used should come from the kind's built in registry, with a single tag, like:
custom/apache-airflow:latest
. The airflow cluster should start up successfully using my custom airflow docker image. I should be able to synchronize dags (and more files in the future) into the cluster.How can we reproduce the bug? (as minimally and precisely as possible)
Use my devspace.yaml and my Dockerfile (just copy constraints from here: https://[raw.githubusercontent.com/apache/airflow/constraints-2.7.3/constraints-3.11.txt](https://raw.githubusercontent.com/apache/airflow/constraints-2.7.3/constraints-3.11.txt and add requirements.txt with any python dependency). Run
devspace dev
and observe the problems I described above.My devspace.yaml:
My Dockerfile:
Local Environment:
Anything else we need to know?