Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Helm test does not include image pull policy #701

Closed
fhaase2 opened this issue Jun 30, 2020 · 5 comments · Fixed by #727
Closed

Helm test does not include image pull policy #701

fhaase2 opened this issue Jun 30, 2020 · 5 comments · Fixed by #727

Comments

@fhaase2
Copy link
Contributor

fhaase2 commented Jun 30, 2020

The helm test does not get the image pull policy. Its not set at all. This can lead to issues.

@jmlrt
Copy link
Member

jmlrt commented Jul 13, 2020

Hi @fhaase2, can you be more explicit about how this can lead to issues?

@fhaase2
Copy link
Contributor Author

fhaase2 commented Jul 13, 2020

Yes sure. When i run helm test it starts the container that is specified here:

  containers:
  - name: "{{ .Release.Name }}-{{ randAlpha 5 | lower }}-test"
    image: "{{ .Values.image }}:{{ .Values.imageTag }}"
    command:
      - "sh"
      - "-c"
      - |
        #!/usr/bin/env bash -e
        curl -XGET --fail '{{ template "elasticsearch.uname" . }}:{{ .Values.httpPort }}/_cluster/health?{{ .Values.clusterHealthCheckParams }}'
  {{- if .Values.imagePullSecrets }}
  imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 4 }}

ImagePullSecret is set and also the image name. But image pull policy is not. If i set a specific pullPolicy on the main values, it does not forward these to the test. Running helm test will fail, because image cannot be pulled for example.

@jmlrt
Copy link
Member

jmlrt commented Jul 13, 2020

I don't get it, imagePullPolicy, allow you to specify if the image should be pulled everytime or reuse the existing one when it is already present on the K8S node.

In any case the image will be pulled if it's not existing on the node. Also as the Helm test container is running a simple curl command, it doesn't really mater having an up to date image or not (note that we don't use latest tag for our Docker images and we never update an existing image tag except for the -SNAPSHOT images used for development).

Finally, the helm test command can be run manually to help validate that the chart was installed successfully but has no impacts on Elasticsearch deployment itself.

@fhaase2
Copy link
Contributor Author

fhaase2 commented Jul 14, 2020

Okay let me explain it more precisely. In one project i use the elasticsearch chart as a dependency. I added it through requirements.yaml.

And in this project we make use of helm tests for other components. Whenever i run helm test on the umbrella chart, it runs all test of the components, including the elasticsearch test. On local development (running kubernetes with docker for mac) imagePullPolicy has to be always on Never, as the image pull does not work with other values (see e.g. here https://stackoverflow.com/questions/50739405/docker-for-mac-kubernetes-reference-local-image).

The test for elasticsearch uses a different imagePullPolicy than specified on the values. Its using the default value, which should be Always. Thats why the elasticsearch test is failing, as it cannot pull the image locally with this setting.

And yes, i agree, its not a critical issue.

@jmlrt
Copy link
Member

jmlrt commented Jul 15, 2020

Thanks for the aditional context. That make sense. Adding imagePullPolicy to test pod should be relatively easy. Do you think you can create a PR for that?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants