Kubernetes cannot pull image from private docker image repository

后端 未结 7 1201
Happy的楠姐
Happy的楠姐 2020-12-17 08:22

I have problem with kubernetes (minikube) and pull images from local image repository on docker. Docker repository was created:

docker run --entrypoint htpas         


        
7条回答
  •  旧时难觅i
    2020-12-17 08:55

    I wanted a one line solution to execute in my terminal. Everything else I tried was overly complex to auth ecr with minikube.

    This is my command for aws ecr login that I run each day because the token expires. The examples below are for Debian 9 with AWS ECR.

    shell

    kubectl create secret docker-registry aws-ecr-credentials \
    --docker-server=$ECR_REGISTRY \
    --docker-username=AWS \
    --docker-password=$(aws ecr get-login | awk '{print $6}') \
    --docker-email=$IAM_EMAIL \
    --namespace=$KUBE_NAMESPACE
    

    template.yml

    spec:
      imagePullSecrets:
        - name: aws-ecr-credentials
    

提交回复
热议问题