Skip to content

Instantly share code, notes, and snippets.

@mwalzer
Created February 12, 2018 11:08
Show Gist options
  • Save mwalzer/b24cc12856f0a24e0ae4893428393d73 to your computer and use it in GitHub Desktop.
Save mwalzer/b24cc12856f0a24e0ae4893428393d73 to your computer and use it in GitHub Desktop.
creates a k8s pod mounting a pvc (must be bound already)
apiVersion: v1
kind: Pod
metadata:
name: init-test-pod-only
spec:
containers:
- name: svn-pod
image: mwalzer/alpine-svn
imagePullPolicy: IfNotPresent
# container will "crash" if no command is present as there is no default entrypoint as e.g. would be in nginx
command: ["/bin/sh"]
args: ["-c", "while true; do echo hello; sleep 10;done"]
volumeMounts:
- mountPath: "/workdir"
name: galaxy-pvc
volumes:
- name: galaxy-pvc
persistentVolumeClaim:
claimName: galaxy-pvc
@mwalzer
Copy link
Author

mwalzer commented Feb 12, 2018

kubectl create -f <path/to/yaml>
kubectl get pods

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment