Volumes Flashcards
PVC
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: pv-claim
spec:
storageClassName: demo
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
Volumes
kind: Pod
apiVersion: v1
metadata:
name: morevol
spec:
containers:
- name: centos1
image: centos:7
command:
- sleep
- “3600”
volumeMounts:
- mountPath: /centos1
name: test
- name: centos2
image: centos:7
command:
- sleep
- “3600”
volumeMounths:
- mountPath: /centos2
name: test
volumes:
- name: test
emptyDir: {}
=============================
kind: Pod
apiVersion: v1
metadata:
name: pv-pod
spec:
volumes:
- name: pv-storage
persistentVolumeClaim:
claimName: pv-claim
containers:
- name: pv-container
image: nginx
ports:
- containerPort: 80
name: “http-server”
volumeMounts:
- mountPath: “/usr/share/nginx/html”
name: pv-storage
PV
kind: PersistentVolume
apiVersion: v1
metadata:
name: pv-volume
labels:
type: local
spec:
storageClassName: demo
capacity:
storage: 2Gi
accessModes:
- ReadWriteOnce
hostPath:
path: “/mydata”