-
Notifications
You must be signed in to change notification settings - Fork 40.9k
[WIP] Adding windows profile to allow kubectl node debug #130807
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
base: master
Are you sure you want to change the base?
Conversation
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. 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. |
|
Welcome @rtkgupta! |
Hi @rtkgupta. 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: rtkgupta 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 |
2ce2462
to
508c9ab
Compare
c.SecurityContext.WindowsOptions = &corev1.WindowsSecurityContextOptions{} | ||
} | ||
c.SecurityContext.WindowsOptions.HostProcess = ptr.To(true) | ||
c.SecurityContext.WindowsOptions.RunAsUserName = ptr.To("NT AUTHORITY\\SYSTEM") |
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.
can you make this configurable?
/sig windows |
if c.Name != containerName { | ||
return true | ||
} |
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.
Where does this pod spec come from? All the containers in a HPC pod must be configured with HostProcess
, so If this pod spec has more than one container I think this wouldn't work.
Since this only used with kubectl debug node command
could this just set the Hostprocess
setting on the pod spec? and verify it isn't false already on any of the containers?
Should there be a check somewhere that makes sure the node selected is a Windows node? We want to be able to run kubectl from a linux (or windows) machine but connect to a windows node using this feature. Maybe, ideally, it would select the proper profile according to which node is selected? |
Signed-off-by: Ritika Gupta <[email protected]>
508c9ab
to
5578318
Compare
|
A few maybe naive questions: Will a successful run of this give user a windows node access, just like logging in to a HPC pod with amdin access? and will the exit of the debug command destroy the deployed HPC pod? |
@zylxjtu Yep! Using this command will bring up an interactive shell which is an hpc, so you have access to host files as NT AUTHORITY\SYSTEM and when you are done debugging the hpc debug container is removed.
|
@@ -56,6 +56,8 @@ const ( | |||
ProfileNetadmin = "netadmin" | |||
// ProfileSysadmin offers elevated privileges for debugging. | |||
ProfileSysadmin = "sysadmin" | |||
// ProfileWindows offers elevated privileges for debugging. | |||
ProfileWindows = "windows" |
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.
My only question will be, is this going to be the only one windows profile? IIUC the only thing you're setting is the host network, so maybe something like win-netadmin
or something that will allow us to add additional windows profiles in the future?
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.
From today's sig-cli call @brianpursley pointed that win-sysadmin
might be a better name. Still to be confirmed with sig-windows TLs.
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.
+1 for win-sysadmin
or winadmin
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
What type of PR is this?
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
This PR allows functionality to use kubectl debug to debug windows nodes using host process containers.
Example usage:
Running windows profile on a linux node errors out as:

Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: