I am facing the issue while pulling the docker image from AWS ECR repository, earlier i used
kubectl create secret docker-registry regcred --docker-server=https://index.docker.io/v1/ --docker-username=kammana --docker-password=<your-password> [email protected]
The deployment YAML file
apiVersion: v1
kind: Pod
metadata:
name: private-reg
spec:
containers:
- name: privateapp
image: kammana/privateapp:0.0.1
imagePullSecrets:
- name: regcred
but now the secret password is only valid for 12 hours when you generate for ECR, i will have to manually change the secret everytime. This is hectic and i read a Medium article.
It can creates kind of cron Job but i want to pull the image at runtime by logging in to ECR.
It would be helpful if you could provide some relevant example with respect ECR direct login via Kubernetes and my cluster is not in the same AWS account so AWS IAM Roles is out of question.