Skip to content

Instantly share code, notes, and snippets.

@resouer
Forked from dims/hostpath-pvc-example.yaml
Created September 25, 2018 03:58
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 resouer/3a52830e60cbec1f36e4f878538010b1 to your computer and use it in GitHub Desktop.
Save resouer/3a52830e60cbec1f36e4f878538010b1 to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv0001
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
path: /tmp/pvc
----
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: myclaim
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
----
apiVersion: v1
kind: Pod
metadata:
name: mypod
spec:
containers:
- name: myfrontend
image: gcr.io/google-containers/nginx:1.7.9
volumeMounts:
- mountPath: "/var/www/html"
name: mypd
volumes:
- name: mypd
persistentVolumeClaim:
claimName: myclaim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment