kubectl run supports --privileged

Created on 15 Sep 2019  路  8Comments  路  Source: kubernetes/kubectl

The docker run command provides a --privileged flag to run a container in privileged mode. In v1.15 kubectl doesn't. A large --overrides flag can badly workaround this. Running a privileged container with -it requires something like this:

k run wanmap-fake-wan --image=bradmwalker/wanmap -it --rm --overrides='{"spec": {"metadata": {"name": "wanmap-fake-wan"}, "template": {"spec": {"containers": [{"name": "wanmap-fake-wan", "image": "bradmwalker/wanmap", "command": ["/bin/sh"], "tty": true, "stdin": true, "securityContext": {"privileged": true} }]}}}}'

[brad@x220 ~]$ kubectl version
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.3", GitCommit:"2d3c76f9091b6bec110a5e63777c332469e0cba2", GitTreeState:"clean", BuildDate:"2019-08-21T15:34:43Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"13+", GitVersion:"v1.13.7-gke.8", GitCommit:"7d3d6f113e933ed1b44b78dff4baf649258415e5", GitTreeState:"clean", BuildDate:"2019-06-19T16:37:16Z", GoVersion:"go1.11.5b4", Compiler:"gc", Platform:"linux/amd64"}

arekubectl kinfeature sicli

Most helpful comment

This is especially useful for debugging network issues via specialized images.

/remove-lifecycle rotten

All 8 comments

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

This is especially useful for debugging network issues via specialized images.

/remove-lifecycle rotten

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

/remove-lifecycle rotten

/area kubectl
/kind feature
/sig cli

/assign

/remove-lifecycle stale

Was this page helpful?
0 / 5 - 0 ratings