Skip to content

Instantly share code, notes, and snippets.

@dims
Created June 21, 2016 17:34
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save dims/916fd6c76b7b2869cfe62242fe4890c2 to your computer and use it in GitHub Desktop.
Save dims/916fd6c76b7b2869cfe62242fe4890c2 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
@dims
Copy link
Author

dims commented Jun 21, 2016

[dims@ubuntu-brix 13:35] ~/ ⟩ ls -altr /tmp/pvc/
total 64
drwxrwxr-x   2 dims dims  4096 Jun 21 13:24 .
-rw-r--r--   1 root root    15 Jun 21 13:24 index.html
drwxrwxrwt 191 root root 53248 Jun 21 13:35 ..
[dims@ubuntu-brix 13:35] ~/ ⟩ kubectl exec -it mypod bash
root@mypod:/# ls -altr /var/www/html/
total 12
drwxrwxr-x 2 1000 1000 4096 Jun 21 17:24 .
-rw-r--r-- 1 root root   15 Jun 21 17:24 index.html
drwxr-xr-x 3 root root 4096 Jun 21 17:33 ..

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