imagePullSecrets should throw error if secret does not exist #104432
Comments
/sig node |
(and/or) |
correct me if not. Pulling private images with nonexists secret, pod will turn to |
Similar issue with #88142.
|
Yes that's correct. |
I think so. Working on this later. Will also live up to your expectations, right? @neilharris123 |
But I check it already have a warnging events if secret not exist and pullImageFail: |
Now, only info message when pullsecret not exist kubernetes/pkg/kubelet/kubelet_pods.go Lines 891 to 895 in 175776d |
maybe direct return and not enter kubernetes/pkg/kubelet/kubelet.go Lines 1725 to 1729 in 175776d |
if you pull image from a public repo, the process should not be impacted even no secrets exists. And it's what it is right now. |
I think a warning event kubernetes/pkg/kubelet/kubelet_pods.go Line 655 in 175776d could be added here kubernetes/pkg/kubelet/kubelet_pods.go Lines 891 to 895 in 175776d /good-first-issue /triage accepted |
@adisky: Please ensure the request meets the requirements listed here. If this request no longer meets these requirements, the label can be removed In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/assign @EricWvi |
@kerthcet: GitHub didn't allow me to assign the following users: EricWvi. Note that only kubernetes members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@calvin0327: GitHub didn't allow me to assign the following users: EricWvi. Note that only kubernetes members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I would like to work in this. |
Thanks for wanting to jump in on this, but it's not clear this is a good first issue… making the proposed change would break deployments/pods that are currently working/running, so it's unlikely this would be acceptable from a compatibility perspective. |
Requiring image pull secrets to exist would have to be opt-in, which means an API change. I don't think this is worth the addition, but would like to hear sig-node's perspective. An alternative could be to explore ways to make it more obvious to the user when this situation was occurring without automatically failing the pod |
hi @liggitt , we will not fail the pod, we just want to add some warning to make it obviously, maybe it's the same as you advised. correct me if not. |
To be clear here, only adding a warning is marked as good first issue here, not changing any pod behaviour. |
gotcha, that seems more reasonable, thanks for clarifying as a note, make sure the warning events are generated at most once in that function, rather than once per missing secret object (if there are multiple missing secrets) |
/good-first-issue |
@liggitt: Please ensure the request meets the requirements listed here. If this request no longer meets these requirements, the label can be removed In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Yes, a warning would be good. I feel an error would have be better, but as has already been mentioned above we are too far along now for this change as it could break some users existing deployments, so a warning makes the most sense now. |
/assign |
@adisky based on what you have stated above, I see an INFO log already exists! If I'm understanding this correctly, now we need to raise a warning event in the same code block to fulfill this request. Is that right? @liggitt @neilharris123 |
I think @calvin0327 has created a pr above and labeled /lgtm already. |
Hey I don't know anything about how to code but i am interested to contribute on kubernetes |
What happened:
imagePullSecrets can added to a pod manifest to reference a secret containing registry credentials. Currently, if you add the name of a secret that does not exist, there is no warning or error.
What you expected to happen:
I would expect there to be an error and a failed deployment if the secret does not exist/cannot be found in the namespace.
If people are pulling public images, they may still wish to authenticate to a registry, for example dockerhub, before pulling the image, in order to utilise their subscription account rate limits. Currently if they use imagePullSecrets and the referenced secret does not exist, they may assume they are authenticating to their account when they are not, and will still be able to pull public images without any warning that authentication is not taking place.
How to reproduce it (as minimally and precisely as possible):
Add
imagePullSecrets: myfakesecret
to a pod spec, and pull images from docker.io.The text was updated successfully, but these errors were encountered: