From 24ea051689e6c24b0509ff5f8238a1d9bd6a75f8 Mon Sep 17 00:00:00 2001 From: tej-singh-rana Date: Tue, 25 Aug 2020 15:09:36 +0530 Subject: [PATCH] Update 13-Practice-Test-Storage-Class.md --- .../13-Practice-Test-Storage-Class.md | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) diff --git a/docs/08-Storage/13-Practice-Test-Storage-Class.md b/docs/08-Storage/13-Practice-Test-Storage-Class.md index 2c1b2b46..3cf1e2e7 100644 --- a/docs/08-Storage/13-Practice-Test-Storage-Class.md +++ b/docs/08-Storage/13-Practice-Test-Storage-Class.md @@ -2,3 +2,148 @@ - Lets do the [Labs](https://kodekloud.com/courses/certified-kubernetes-administrator-with-practice-tests/lectures/23710917) + +#### Solution + + 1. Check the Solution + +
+ + ``` + 0 + ``` + +
+ + 2. Check the Solution + +
+ + ``` + 2 + ``` +
+ + 3. Check the Solution + +
+ + ``` + local-storage + ``` +
+ + 4. Check the Solution + +
+ + ``` + WaitForFirstConsumer + ``` +
+ + 5. Check the Solution + +
+ + ``` + portworx-volume + ``` + +
+ + 6. Check the Solution + +
+ + ``` + NO + ``` +
+ + 7. Check the Solution + +
+ + ``` + apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + name: local-pvc + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 500Mi + storageClassName: local-storage + ``` +
+ + 8. Check the Solution + +
+ + ``` + Pending + ``` +
+ + 9. Check the Solution + +
+ + ``` + A Pod consuming the volume in not scheduled + ``` +
+ + 10. Check the Solution + +
+ + ``` + 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. + ``` +
+ + 11. Check the Solution + +
+ + ``` + apiVersion: v1 + kind: Pod + metadata: + name: nginx + labels: + name: nginx + spec: + containers: + - name: nginx + image: nginx:alpine + volumeMounts: + - name: local-persistent-storage + mountPath: /var/www/html + volumes: + - name: local-persistent-storage + persistentVolumeClaim: + claimName: local-pvc + ``` +
+ + 12. Check the Solution + +
+ + ``` + apiVersion: storage.k8s.io/v1 + kind: StorageClass + metadata: + name: delayed-volume-sc + provisioner: kubernetes.io/no-provisioner + volumeBindingMode: WaitForFirstConsumer + ``` +
+ +