Home > Enterprise >  Kubernetes InvalidImageName pulling a Docker image from private repository
Kubernetes InvalidImageName pulling a Docker image from private repository

Time:10-13

I'm trying, for a simple test, to connect my local Kubernetes instance (running in Docker Desktop) to a private repository on AWS ECR in order to download and Install a simple Java Web Application but after the installation of the Helm chart I get an error "InvalidImageName" from the k9s console.

I already pushed the application docker image into the registry and the URI is something like:

123456789.dkr.ecr.eu-west-1.amazonaws.com/myapp:0.0.3

I also created an Helm chart to deploy the webapp on k8s an I configured the values.xml in this way:

image:
  repository: 123456789.dkr.ecr.eu-west-1.amazonaws.com/myapp:0.0.3
  pullPolicy: IfNotPresent

imagePullSecrets:
  - name: ecrtest-sec

I also created the Kubernetes secret passing my accesskey and secret key credentials for ECR like:

kubectl create secret docker-registry ecrtest-sec --docker-server=123456789.dkr.ecr.eu-west-1.amazonaws.com --docker-username=myusername --docker-password=mypassword --docker-email=myemailaddress

but, as I said before, it doesn't work for the error aforementioned:

"InvalidImageName"

CodePudding user response:

Try this:

image:
     repository: "123456789.dkr.ecr.eu-west-1.amazonaws.com/myapp"
     tag: "0.0.3"
     pullPolicy: IfNotPresent
  • Related