-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image handling does not match values.yaml structure from helm create #360
Comments
Thanks for the descriptive issue. This is something I noticed when developing the helm deployer. I'm not sure what the best path forward is. We should absolutely work with stock charts that separate image name and tag. I'm not sure the best way to expose this. The helm deployer could just inject tag only by default. How does that sound? |
I find a workaround for current version: change skaffold.yaml to values:
# image: skaffold-helm
imageName: skaffold-helm then change deployment.yaml containers:
- name: {{ .Chart.Name }}
# image: {{ .Values.image }}
image: {{ if .Values.imageName }}{{ .Values.imageName }}{{ else }}"{{ .Values.image.repository }}:{{ .Values.image.tag }}"{{ end }}
# imagePullPolicy: {{ .Values.pullPolicy }}
imagePullPolicy: {{ .Values.image.pullPolicy }} I think the correct way is not to use |
Just to throw in one more wrinkle: We often split our image definition into three parts:
Where component is the application (nginx, my-app, etc.) We do this so we can easily swap out the top level repository (say from quay.io to the docker hub). |
The way that I deal with this issue right now is to have an umbrella chart and allow for override values compatible with skaffold, e.g. in values.yaml:
And then I have a named template to handle it:
|
I've envisioned something in the config line of:
This will enable the following example deployment config:
will create the following CLI: and if we use:
CLI will be: |
Add deployment to the skaffold pipeline. Skaffold only supports images in single value format - see GoogleContainerTools/skaffold#360. To workaround that, define single value image definition to be used by skaffold as well as name templates that will use these only when they are defined.
I don't know if there is a smarter/more efficient way to do this, but I ended up using this for a helm chart with a lot of different images that I wanted to easily set the tag and registry for CD purposes. More variables could be added to the coalesce if there were other places where values would be stored. And instead of passing in a string variable as the second part of the list, it could be a dict for a "helm convention"
|
@enriched can you open a separate issue for that? |
Yes, thank you |
The sample chart created by
helm create
uses nested variables for docker images.The same is a common practice in stable charts as well:
The manifest template fetches the details of image from
.Values
accordingly:Skaffold overrides the image using the key specified in its pipeline configuration, and it appends the image_name:tag to it, which is not compatible with the value being split into repository and tag.
Expected behavior
The rendered manifest should be something like:
Actual behavior
Instead what happens is:
Information
Skaffold version: v0.2.0 (built from source)
Operating system: macOS Sierra 10.12.6
Content of skaffold.yaml:
I appreciate that there is no fixed structure for how the image variable is defined, but the current behaviour does not help using skaffold with many stock charts, and it forces putting image name and tag together.
The text was updated successfully, but these errors were encountered: