Skip to content

Instantly share code, notes, and snippets.

@a-shevtsov
Created July 2, 2019 20:54
Show Gist options
  • Save a-shevtsov/6e01a7c87eb9354726de9ef8f2f1096b to your computer and use it in GitHub Desktop.
Save a-shevtsov/6e01a7c87eb9354726de9ef8f2f1096b to your computer and use it in GitHub Desktop.
Start pod with mounted PVC
kubectl run -i --rm --tty busybox --overrides='
{
"kind": "Pod",
"apiVersion": "v1",
"spec": {
"containers": [
{
"name": "busybox",
"image": "busybox",
"args": [
"/bin/sh"
],
"stdin": true,
"stdinOnce": true,
"tty": true,
"volumeMounts": [{
"mountPath": "/<volume-name>",
"name": "<volume-name>"
}]
}
],
"volumes": [{
"name": "<volume-name>",
"persistentVolumeClaim": {
"claimName": "<pvc-name>"
}
}]
}
}
' --image=busybox --restart=Never -- sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment