I have problem with kubernetes (minikube) and pull images from local image repository on docker. Docker repository was created:
docker run --entrypoint htpas
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