Skip to content

Instantly share code, notes, and snippets.

@bprashanth
Last active June 20, 2016 22:01
Show Gist options
  • Save bprashanth/e811187c9f9839d8809b569a74315466 to your computer and use it in GitHub Desktop.
Save bprashanth/e811187c9f9839d8809b569a74315466 to your computer and use it in GitHub Desktop.
simple pv
apiVersion: v1
kind: PersistentVolume
metadata:
name: test
spec:
capacity:
storage: 200Gi
accessModes:
- ReadWriteOnce
gcePersistentDisk:
# this pd must exist
# gcloud compute disks create test-disk
pdName: test-disk
fsType: ext4
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: test
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 200Gi
---
apiVersion: v1
kind: Pod
metadata:
generateName: test-
spec:
terminationGracePeriodSeconds: 0
containers:
- name: busybox
image: busybox
command:
- sh
- -c
- touch /data/`hostname`; while true; do sleep 3600; done
volumeMounts:
- name: data
mountPath: /data
volumes:
- name: data
persistentVolumeClaim:
claimName: test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment