Skip to content

Instantly share code, notes, and snippets.

@PhilipSchmid
Created July 18, 2023 11:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PhilipSchmid/ec4996c0c21f4bb952731339bf3546be to your computer and use it in GitHub Desktop.
Save PhilipSchmid/ec4996c0c21f4bb952731339bf3546be to your computer and use it in GitHub Desktop.
kubectl run Pod with hostPath
kubectl run -it --rm tshoot --overrides='
{
"spec": {
"containers": [
{
"name": "tshoot",
"image": "nicolaka/netshoot:latest",
"command": ["/bin/bash"],
"stdin": true,
"stdinOnce": true,
"tty": true,
"volumeMounts": [{
"mountPath": "/host/etc",
"name": "hostdir"
}]
}
],
"volumes": [{
"name":"hostdir",
"hostPath": {
"path": "/etc",
"type": "Directory"
}
}]
}
}
' --image=nicolaka/netshoot:latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment