-
Notifications
You must be signed in to change notification settings - Fork 40.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(kubectl): implement support for image pull secrets for debug sub command #128061
Conversation
The current implementation of the debug command does not support using images from private repositories. This patch adds the --pull-image-secret option that allows to set an image-pull-secret that will be added to the pod created for the debugging session.
Welcome @sgaist! |
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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-sigs/prow repository. |
Hi @sgaist. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sgaist The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@@ -205,6 +206,7 @@ func (o *DebugOptions) AddFlags(cmd *cobra.Command) { | |||
cmd.Flags().BoolVar(&o.KeepInitContainers, "keep-init-containers", o.KeepInitContainers, i18n.T("Run the init containers for the pod. Defaults to true.(This flag only works when used with '--copy-to')")) | |||
cmd.Flags().StringToStringVar(&o.SetImages, "set-image", o.SetImages, i18n.T("When used with '--copy-to', a list of name=image pairs for changing container images, similar to how 'kubectl set image' works.")) | |||
cmd.Flags().String("image-pull-policy", "", i18n.T("The image pull policy for the container. If left empty, this value will not be specified by the client and defaulted by the server.")) | |||
cmd.Flags().StringVar(&o.ImagePullSecret, "image-pull-secret", o.ImagePullSecret, i18n.T("The image pull secret to use for pulling image of the debug container.")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is duplicate of kubernetes/kubectl#1567 and kubernetes/kubectl#1506. I closed them by referencing this feature kubernetes/enhancements#4292. However, we have decided to pursue another path and KEP does not fix the issue described in there.
I believe that it makes sense to have such a flag. But I think we should first update this KEP https://github.com/kubernetes/enhancements/tree/master/keps/sig-cli/1441-kubectl-debug to agree upon the design. For example, setting pull secret directly in CLI would leak the secret in terminal history and would not be sufficiently secure. If we expose this via secret
, then we have to decide how does command access the secrets in other namespaces, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or what is the expected behavior for copy-to pod, ephemeral debug, debugging node, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ardaguclu I haven't yet worked on a KEP so what would the best way to start the update discussion ? The README of the enhancement repository does not describe that.
It would be probably a better idea to have a generic way to support other configurations (for example |
I am sorry, while doing some cleanup, I forgot I had this PR running so it was not my intention to close it. I have restored the fork and the branch and would be happy to continue the work started here. |
We just run into the need of this. @Hathoute, It seems, |
What type of PR is this?
/kind feature
What this PR does / why we need it:
The current implementation of the debug command does not support using images from private repositories. This patch adds the --pull-image-secret option that allows to set an image-pull-secret that will be added to the pod created for the debugging session.
Which issue(s) this PR fixes:
Fixes kubernetes/kubectl#1671
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: