title: Running a ECR image locally with helm and Kubernetes
body: <p>I'm new to Kubernetes and as a tutorial for myself I've been working on deploying a basic project to Kubernetes with helm (v3).
  I have an image in AWS's ECR as well as a local helm chart for this project.
  However, I am struggling to run my image with Kubernetes.</p>
  
  <p>My image is set up correctly. If I try something like <code>docker run my_image_in_ecr</code> locally it behaves as expected (after configuring my IAM access credentials locally).
  My helm chart is properly linted and in my image map, it specifies:</p>
  
  <pre><code>image:
    repository: my_image_in_ecr
    tag: latest
    pullPolicy: IfNotPresent
  </code></pre>
  
  <p>When I try to use helm to deploy though, I'm running into issues. 
  My understanding is to run my program with helm, I should:</p>
  
  <ol>
  <li><p>Run helm install on my chart</p></li>
  <li><p>Run the image inside my new kubernetes pod</p></li>
  </ol>
  
  <p>But when I look at my kubernetes pods, it looks like they never get up and running.</p>
  
  <pre><code>hello-test1-hello-world-54465c788c-dxrc7           0/1     ImagePullBackOff    0          49m
  hello-test2-hello-world-8499ddfb76-6xn5q           0/1     ImagePullBackOff    0          2m45s
  hello-test3-hello-world-84489658c4-ggs89           0/1     ErrImagePull        0          15s
  </code></pre>
  
  <p>The logs for these pods look like this:</p>
  
  <pre><code>Error from server (BadRequest): container "hello-world" in pod "hello-test3-hello-world-84489658c4-ggs89" is waiting to start: trying and failing to pull image
  </code></pre>
  
  <p>Since I don't know how to set up imagePullSecrets properly with Kubernetes I was expecting this to fail. But I was expecting a different error message such as bad auth credentials. </p>
  
  <ol>
  <li>How can I resolve the error in image pulling? Is this issue not even related to the fact that my image is in ecr?</li>
  <li>How can I properly set up credentials (such as imagePullSecrets) to authorize pulling the image from ecr? I have followed some guides such as <a href="https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/" rel="nofollow noreferrer">this one</a> and <a href="https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry" rel="nofollow noreferrer">this one</a> but am confused on how to tranlate this information into a proper authorization configuration for ecr.</li>
  </ol>