본문 바로가기
cloud/k8s(문제풀이)

[k8s]Kodekloud-storageClasses

by mozi2 2022. 8. 1.
반응형

1. How many StorageClasses exist in the cluster right now?

k get sc

A)1

 

2.How about now? How many Storage Classes exist in the cluster?

We just created a few new Storage Classes. Inspect them.

k get sc

A) 3 

 

3. What is the name of the Storage Class that does not support dynamic volume provisioning?

k get sc

A) local-storage 

 

4. What is the Volume Binding Mode used for this storage class (the one identified in the previous question)?

k describe sc local-storage

A) WaitForFirstConsumer

 

5. What is the Provisioner used for the storage class called portworx-io-priority-high?

k describe sc portworx-io-priority-high

A) portworx-volume

 

6. Is there a PersistentVolumeClaim that is consuming the PersistentVolume called local-pv?

k get pvc

A) NO

 

7.Let's fix that. Create a new PersistentVolumeClaim by the name of local-pvc that should bind to the volume local-pv.

Inspect the pv local-pv for the specs.

  • PVC: local-pvc

  • Correct Access Mode?

  • Correct StorageClass Used?

  • PVC requests volume size = 500Mi?

vi local-pvc.yaml
k apply -f local-pvc.yaml

A)ok

 

8. What is the status of the newly created Persistent Volume Claim?

k get pvc

A) pending 

 

9.Why is the PVC in a pending state despite making a valid request to claim the volume called local-pv?

Inspect the PVC events.

kubectl describe pvc local-pvc

A) A Pod consuming the volume is not scheduled

 

10. The Storage Class called local-storage makes use of VolumeBindingMode set to WaitForFirstConsumer. This will delay the binding and provisioning of a PersistentVolume until a Pod using the PersistentVolumeClaim is created.

 

A) ok

 

11.Create a new pod called nginx with the image nginx:alpine. The Pod should make use of the PVC local-pvc and mount the volume at the path /var/www/html.

The PV local-pv should in a bound state.

  • Pod created with the correct Image?

  • Pod uses PVC called local-pvc?

  • local-pv bound?

  • nginx pod running?

  • Volume mounted at the correct path?
k run nginx --image=nginx:alpine --dry-run=client -o yaml > nginx.yaml
vi nginx.yaml
k apply -f nginx.yaml

 

12.What is the status of the local-pvc Persistent Volume Claim now?

k get pvc local-pvc

A) Bound

 

13.Create a new Storage Class called delayed-volume-sc that makes use of the below specs:

provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer

  • Storage Class uses: kubernetes.io/no-provisioner ?

  • Storage Class volumeBindingMode set to WaitForFirstConsumer ? 

A) ok 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

728x90
반응형

'cloud > k8s(문제풀이)' 카테고리의 다른 글

[K8S]Network-CNI Weave  (0) 2022.08.01
[k8s]Networking-Explore Environment  (0) 2022.08.01
[k8s]kodekloud-Persistent volume Claims  (0) 2022.07.05
[cka] kodekloud-Network Policies  (0) 2022.07.01
[cka]kodekloud-security contexts  (0) 2022.07.01