Skip to content

Instantly share code, notes, and snippets.

@toms-place
Created June 13, 2023 14:18
Show Gist options
  • Save toms-place/44f7dd8a12693304d3a8f6a3f31ceb74 to your computer and use it in GitHub Desktop.
Save toms-place/44f7dd8a12693304d3a8f6a3f31ceb74 to your computer and use it in GitHub Desktop.
kubectl run with volume mount
kubectl run -it --rm ubuntu --overrides='
{
"apiVersion": "v1",
"spec": {
"containers": [
{
"name": "ubuntu",
"image": "ubuntu:latest",
"args": [
"bash"
],
"stdin": true,
"stdinOnce": true,
"tty": true,
"volumeMounts": [{
"mountPath": "/dev/shm",
"name": "store"
}]
}
],
"volumes": [{
"name":"store",
"emptyDir": {
"medium": "Memory",
"sizeLimit": "1Gi"
}
}]
}
}
' --image=ubuntu:latest --restart=Never -- bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment