Answers: <p>Why are you adding the image tag to the pull policy? you dont need it there, just leave it like this: <code>imagePullPolicy: {{ .Values.image.pullPolicy }}</code></p>
  
Answers: CC BY-SA 4.0
Answers: 2020-01-19T16:53:49.580Z
Answers: 2020-01-19T16:53:49.580Z
Answers: ryudice
Answers: <p>Based on the error message it seems that the yaml is invalid:</p>
  
  <pre><code>Unsupported value: "IfNotPresent:ef86dfe0b703": supported values: 
  "Always", "IfNotPresent", "Never"
  </code></pre>
  
  <p>It seems that <code>IfNotPresent</code> contains some tag and that is unsupported.</p>
  
Answers: CC BY-SA 4.0
Answers: 2019-12-20T11:15:35.217Z
Answers: 2019-12-20T11:15:35.217Z
Answers: 030
Body: <p>I'm using Helm v3 with AWS ECR on a Kubernetes cluster that was creating using Kops. I have checked and the role kops assigned to the nodes does have ECR permissions. When I deploy my helm chart I just get <code>imagepullbackoff</code> when doing <code>kubectl get pods</code> in the correct namespace. </p>
  
  <p>Below is some of my helm chart code, I hope this is everything that's needed to debug this issue. BTW I have looked around on SO and google, both come up short on ECR with Helm and nothing for Helm 3 - was released recently. </p>
  
  <p>Inside my <code>values.yaml</code></p>
  
  <pre><code>image:
    repository: &lt;number&gt;.dkr.ecr.us-east-1.amazonaws.com/apigw
    # tag: latest
    tag: ef86dfe0b703
    pullPolicy: IfNotPresent
  </code></pre>
  
  <p>Note that the tag there is a git commit ID and spinnaker will change that on each deployment so here being static is just to test.</p>
  
  <p>I was following this guide and as a result changed some things that might have effected it. </p>
  
  <p><a href="https://aws.amazon.com/blogs/opensource/deployment-pipeline-spinnaker-kubernetes/" rel="nofollow noreferrer">https://aws.amazon.com/blogs/opensource/deployment-pipeline-spinnaker-kubernetes/</a></p>
  
  <p>Main one I think that makes a difference is </p>
  
  <pre><code> imagePullPolicy: "{{ .Values.image.pullPolicy }}:{{ .Values.image.tag}}"
  </code></pre>
  
  <p>to </p>
  
  <pre><code>imagePullPolicy: {{ .Values.image.pullPolicy }}
  </code></pre>
  
  <p>However... If I change it back I get this error when trying to apply the helm chart</p>
  
  <pre><code>Error: Deployment.apps "apigw" is invalid: spec.template.spec.containers[0].imagePullPolicy: Unsupported value: "IfNotPresent:ef86dfe0b703": supported values: "Always", "IfNotPresent", "Never"
  </code></pre>
  
Comments: CC BY-SA 4.0
Comments: 2019-11-21T10:43:54.703Z
Comments: Did you add a secret to k8s in order to pull the image?
Comments: 030
Comments: CC BY-SA 4.0
Comments: 2019-11-21T23:26:21.937Z
Comments: @030 No? I added nothing to K8's for the images? I have the ECR role assigned to my nodes which should be good enough. What kind of secret are you thinking of?
Comments: joshk132
Comments: CC BY-SA 4.0
Comments: 2019-11-22T08:56:27.800Z
Comments: I meant `imagePullSecrets`, see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
Comments: 030
Tags: <docker><amazon-web-services><kubernetes><helm>
Title: Unable to get Helm to work with ECR
UserDisplayName: joshk132
ThreadText: # Unable to get Helm to work with ECR
  
  (Asked by: username_0 on 2019-11-20)
  
  I'm using Helm v3 with AWS ECR on a Kubernetes cluster that was creating using Kops. I have checked and the role kops assigned to the nodes does have ECR permissions. When I deploy my helm chart I just get `imagepullbackoff` when doing `kubectl get pods` in the correct namespace.
  
  Below is some of my helm chart code, I hope this is everything that's needed to debug this issue. BTW I have looked around on SO and google, both come up short on ECR with Helm and nothing for Helm 3 - was released recently.
  
  Inside my `values.yaml`
  
  ```
  image:
    repository: <number>.dkr.ecr.us-east-1.amazonaws.com/apigw
    # tag: latest
    tag: ef86dfe0b703
    pullPolicy: IfNotPresent
  
  ```
  
  Note that the tag there is a git commit ID and spinnaker will change that on each deployment so here being static is just to test.
  
  I was following this guide and as a result changed some things that might have effected it.
  
  <https://aws.amazon.com/blogs/opensource/deployment-pipeline-spinnaker-kubernetes/>
  
  Main one I think that makes a difference is
  
  ```
   imagePullPolicy: "{{ .Values.image.pullPolicy }}:{{ .Values.image.tag}}"
  
  ```
  
  to
  
  ```
  imagePullPolicy: {{ .Values.image.pullPolicy }}
  
  ```
  
  However... If I change it back I get this error when trying to apply the helm chart
  
  ```
  Error: Deployment.apps "apigw" is invalid: spec.template.spec.containers[0].imagePullPolicy: Unsupported value: "IfNotPresent:ef86dfe0b703": supported values: "Always", "IfNotPresent", "Never"
  
  ```
  
  **Tags:** docker, amazon-web-services, kubernetes, helm
  
  > **Comments:**
  > **username_1**: Did you add a secret to k8s in order to pull the image?  
  > **username_0**: @username_1 No? I added nothing to K8's for the images? I have the ECR role assigned to my nodes which should be good enough. What kind of secret are you thinking of?  
  > **username_1**: I meant `imagePullSecrets`, see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2020-01-19. Score: 1
  
  Why are you adding the image tag to the pull policy? you dont need it there, just leave it like this: `imagePullPolicy: {{ .Values.image.pullPolicy }}`
  
  
  ---
  
  ### Answer by username_1 on 2019-12-20. Score: 0
  
  Based on the error message it seems that the yaml is invalid:
  
  ```
  Unsupported value: "IfNotPresent:ef86dfe0b703": supported values: 
  "Always", "IfNotPresent", "Never"
  
  ```
  
  It seems that `IfNotPresent` contains some tag and that is unsupported.
  
  
  ---
  
  