<p>I am running Apache Kafka on Kubernetes via Strimzi operator.
I am trying to install Kafka Connect with mysql debezium connector.</p>
<p>This is the Connector configuration file:</p>
<pre><code>apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaConnect
metadata:
  name: my-connect-cluster
  annotations:
    strimzi.io/use-connector-resources: &quot;true&quot;
spec:
  version: 3.1.0
  replicas: 1
  bootstrapServers: &lt;bootstrap-server&gt;
  config:
    group.id: connect-cluster
    offset.storage.topic: connect-cluster-offsets
    config.storage.topic: connect-cluster-configs
    status.storage.topic: connect-cluster-status
    config.storage.replication.factor: -1
    offset.storage.replication.factor: -1
    status.storage.replication.factor: -1
  build: 
    output: 
      type: docker
      image: &lt;my-repo-in-ecr&gt;/my-connect-cluster:latest
      pushSecret: ecr-secret
    plugins: 
    - name: debezium-mysql-connector
      artifacts:
      - type: tgz
        url: https://repo1.maven.org/maven2/io/debezium/debezium-connector-mysql/1.9.0.Final/debezium-connector-mysql-1.9.0.Final-plugin.tar.gz
</code></pre>
<p>I created the ecr-secret in this way:</p>
<pre><code>kubectl create secret docker-registry ecr-secret \
  --docker-server=${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com \
  --docker-username=AWS \
  --docker-password=$(aws ecr get-login-password) \
  --namespace=default
</code></pre>
<p>The error I get is the following:</p>
<blockquote>
<p>error checking push permissions -- make sure you entered the correct
tag name, and that you are authenticated correctly, and try again:
checking push permission for
&quot;/my-connect-cluster:latest&quot;:
POST https:/ │ │ Stream closed EOF for
default/my-connect-cluster-connect-build
(my-connect-cluster-connect-build)</p>
</blockquote>
<p>I am not sure what permission I should check. I already tried to use a configuration of the aws cli with a role with admin priviledge just to debug but I got the same error. Any guess?</p>

<p>I thought some role was missing from the node in the EKS cluster but that is not the case since the only thing needed to authenticate is the information contained in the secret. <br>  <br></p>
<p>The error was actually in the secret creation: two details are very relevant:</p>
<ol>
<li>the --region flag in the aws ecr get-login-password command was missing and therefore a different password was generated.</li>
<li>the https:// is needed in front of the docker-server</li>
</ol>
<p>Below the right command for the secret generation.</p>
<pre><code>kubectl create secret docker-registry ecr-secret \
  --docker-server=https://${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com \
  --docker-username=AWS \
  --docker-password=$(aws ecr get-login-password --region eu-central-1) \
  --namespace=default
</code></pre>
