Linux Foundation CKA Exam - Topic 12 Question 50 Discussion
Score:7%TaskCreate a new PersistentVolumeClaim* Name: pv-volume* Class: csi-hostpath-sc* Capacity: 10MiCreate a new Pod which mounts the PersistentVolumeClaim as a volume:* Name: web-server* Image: nginx* Mount path: /usr/share/nginx/htmlConfigure the new Pod to have ReadWriteOnce access on the volume.Finally, using kubectl edit or kubectl patch expand the PersistentVolumeClaim to a capacity of 70Mi and record that change.
A) Explanation:
Solution:
vi pvc.yaml
storageclass pvc
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pv-volume
spec:
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
resources:
requests:
storage: 10Mi
storageClassName: csi-hostpath-sc
# vi pod-pvc.yaml
apiVersion: v1
kind: Pod
metadata:
name: web-server
spec:
containers:
- name: web-server
image: nginx
volumeMounts:
- mountPath: '/usr/share/nginx/html'
name: my-volume
volumes:
- name: my-volume
persistentVolumeClaim:
claimName: pv-volume
# craete
kubectl create -f pod-pvc.yaml
#edit
kubectl edit pvc pv-volume --record
Gregoria
7 months agoCristal
7 months agoChristiane
7 months agoCordelia
7 months agoBrandon
8 months agoMarta
8 months agoWillard
8 months agoLura
8 months agoJamal
8 months agoCarmelina
8 months agoNana
8 months agoSharika
8 months agoCeleste
8 months agoIlona
9 months agoLouann
9 months agoLindsey
9 months agoAlysa
9 months ago