Chapter 5 – Demystifying Kubernetes Storage
You have two virtual machines: master-0
and worker-0
. Please complete the following mock scenarios.
Scenario 1
Create a new PV called packt-data-pv
with a storage of 2GB, and two persistent volume claims (PVCs) requiring 1GB local storage each.
Create a yaml definition called packt-data-pv.yaml
for persistent volume as the following:
apiVersion: v1
kind: PersistentVolume
metadata:
name: packt-data-pv
spec:
storageClassName: local-storage
capacity:
storage: 2Gi
accessModes:
- ReadWriteOnce
Use the following command to deploy the yaml manifest:
kubectl apply -f packt-data-pv.yaml
Create a yaml definition called packt-data-pvc1.yaml
for persistent volume claim as...