nabsul / k8s-ecr-login-renew

Renews Docker login credentials for an AWS ECR container registry.
MIT License
205 stars 49 forks source link

new deployment or pod using imagepullsecret as default #29

Closed vjvel closed 1 year ago

vjvel commented 2 years ago

Hi,

I am wondering how the pod or deployment is creating with imagepullsecret.

I have enabled the few namespace as target in cronjob and all the namespace there is secret updated. We have role and rolebinding in place.

Out of which only 2 namespace,If i create any pod or deployment it automatically passing the imagepullsecret . I don't know how. Can you please explain that.

nabsul commented 2 years ago

Are you defining imagePullSecret for all of your pods? I don't really know of a way to automatically pass in the imagepullsecret. The way I do it is by adding it to my deployment definition like so:

image

You can add an imagePullSecret to pods, replica sets. etc. as well.

I hope that helps. If not, I'd need to know more about your setup to give more detailed help.

vjvel commented 2 years ago

Hi @nabsul I found it, the imagePullsecrets was added in the default serviceaccount. So when i create a pod or deployment it automatically add this paramenter in the config. Thanks for responding.

nabsul commented 2 years ago

I did not know about this, thanks for sharing!

I found more details here: https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/#serviceaccount-admission-controller