-
Notifications
You must be signed in to change notification settings - Fork 40.6k
Added --privileged flag to kubectl run #90569
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
Conversation
/sig cli |
/retest |
/lgtm |
Agreed it is not a production use thing, or should not be. The functionally already exists if you create your pod using yaml. This just adds a way to use it from the command line. I too am interested if others have opinions on if this is too dangerous to make convenient. |
/retest |
2 similar comments
/retest |
/retest |
/assign @mengqiy |
This doesn't really add or change any new security-related functionality, it just makes it more convenient to do what you can already do. For example: The existing way to do this is:
This PR lets you just do this instead:
@zhouya0 do you have anyone else in mind who might have some thoughts on this? I can add them. /cc @mengqiy |
Looks great, but I believe @mengqiy is not available since he is not active for a long time. You may ask more approvers to review this. |
Rebased |
/retest |
/assign @soltysh |
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brianpursley, soltysh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test pull-kubernetes-e2e-gce-ubuntu-containerd |
is this adding privileged to the debug container or just the default deployment that gets created with run ? |
Copying ideas from docker should always be questioned. I spend a lot of time explaining to developers that there docker compose files are inherently insecure. Most of the time the host system is modified on their laptops. Most time the containers use privileges. Now you copied this mess into kubernetes. Adding privileges with a simple flag will cause real damages in production. This will keep me busy for the next ten years. What you really should do is add PSP as a default everywhere. |
Worried about the impact? You can suggest a revision against the dev-1.19 branch in k/website with a cautionary note where it makes sense. (BTW, if you want to update the generated reference docs, those are based on the upstream code). |
@krmayankk This flag just does the equivalent of setting So for example, if I do this:
And then look at the pod...
It shows:
Starting in Kubernetes 1.19, run no longer will create a deployment (you would use |
Just to be clear, this flag only enables, via a command-line flag, what you were already able to do using yaml, and it only does this for |
@thomasfricke If you are worrying about windows privileged problems, it's not related to this PR because windows pods must have:
to enable admin. |
Shouldn't it at least spit out a big fat warning? |
I wouldn't be worried about your concern @garloff, currently |
Hackers will probably avoid this because the documentation clearly says it's for debugging purposes. We all know, hackers are the first to read the docs and will always abide by it. |
@erikbgithub It is mentioned in this issue that you can already do this with convoluted command. This change won't affect people with malicious intent but help people adopt Kubernetes faster. There are lots of workloads needs to be run on privileged mode, mostly legacy ones and I believe this will only increase adoption. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Adds
--privileged
flag tokubectl run
Which issue(s) this PR fixes:
Fixes kubernetes/kubectl#721
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
EDIT: I'm adding this here because there were some questions/concerns about the security implications of this: