<p>I am trying to push an example application to Knative however I am running into the following error message: </p>

<p><code>Revision "..." failed with message: Unable to fetch image "...": unsupported status code 401; body: Not Authorized</code></p>

<p>Knative is setup properly on EC2 and I've already created a service account and secret to pull from ECR. What am I missing? I'm not sure why Knative can't access my private AWS repository even though K8s (not Knative) is able to. </p>

<p>Secret:</p>

<pre><code>apiVersion: v1
kind: Secret
metadata:
  name: registry-push-secret
  annotations:
    build.knative.dev/docker-0: https://....
type: kubernetes.io/basic-auth
stringData:
  username: token
  password: &lt;token_value&gt;
</code></pre>

<p>Knative Secret: </p>

<pre><code>kubectl create secret docker-registry secret-name --docker-server=https://... --docker-username=token --docker-password=&lt;token_value&gt;
</code></pre>

<p>Service Account: </p>

<pre><code>apiVersion: v1
kind: ServiceAccount
metadata:
  name: test-sa
secrets:
  - name: registry-push-secret
imagePullSecrets:
  - name: secret-name
</code></pre>

<p>Knative Config:</p>

<pre><code>apiVersion: serving.knative.dev/v1alpha1 
kind: Service
metadata:
  name: test 
  namespace: default
spec:
  runLatest:
    configuration:
      revisionTemplate:
        spec:
          serviceAccountName: test-sa
          container:
            image: ... 
            imagePullPolicy: Always
            env:
              - name: TARGET 
                value: "..."
</code></pre>

<p>For anyone that stumbles into this, it was eventually resolved in the Github Issue: <a href="https://github.com/knative/serving/issues/1996" rel="nofollow noreferrer">https://github.com/knative/serving/issues/1996</a></p>
