How to set docker image in `KubernetesRun` to be ...
# ask-community
g
How to set docker image in
KubernetesRun
to be pulled from aws ecr?
c
Have you tried just providing it with the fully qualified ECR image url?
🚀 1
Something like
Copy code
<http://aws_account_id.dkr.ecr.us-west-2.amazonaws.com/amazonlinux:latest|aws_account_id.dkr.ecr.us-west-2.amazonaws.com/amazonlinux:latest>
g
yes... its a private repo...
t
if your image is private, you may want to add image pull secrets
g
do we have any example for that?
t
the KubernetesRun takes image_pull_secrets, or you can define them in the agent
1
t
you should be able to use this (assuming you have local ECR credentials and properly set your kube context) to create an imagepullsecret for your ECR image
Copy code
kubectl create secret docker-registry regcred \
  --docker-server=<aws-account-id>.dkr.ecr.<aws-region>.<http://amazonaws.com|amazonaws.com> \
  --docker-username=AWS \
  --docker-password=$(aws ecr get-login-password) \
  --namespace=$NAMESPACE_NAME || true && \
then just reference the name of that imagepullsecret in your run config
👍 1
the kubernetes docs on imagepullsecrets are here
👍 1