|
| 1 | +--- |
| 2 | +title: "Kubernetes Volumes Challenge Exam" |
| 3 | +passing_percentage: 70 |
| 4 | +type: "test" |
| 5 | +questions: |
| 6 | + - id: "q1" |
| 7 | + text: "What is the purpose of a PersistentVolumeClaim (PVC) in a Kubernetes cluster?" |
| 8 | + type: "single-answer" |
| 9 | + marks: 2 |
| 10 | + options: |
| 11 | + - id: "a" |
| 12 | + text: "To manage the control plane of the cluster" |
| 13 | + - id: "b" |
| 14 | + text: "To create and access persistent storage for reading and writing data" |
| 15 | + is_correct: true |
| 16 | + - id: "c" |
| 17 | + text: "To automatically scale the cluster's worker nodes" |
| 18 | + - id: "d" |
| 19 | + text: "To configure load balancers for the cluster" |
| 20 | + |
| 21 | + - id: "q2" |
| 22 | + text: "Which of the following are true about the accessModes field in a PVC configuration for DigitalOcean Kubernetes?" |
| 23 | + type: "multiple-answers" |
| 24 | + marks: 2 |
| 25 | + options: |
| 26 | + - id: "a" |
| 27 | + text: "ReadWriteOnce is supported by DigitalOcean volumes." |
| 28 | + is_correct: true |
| 29 | + - id: "b" |
| 30 | + text: "ReadOnlyMany is supported by DigitalOcean volumes." |
| 31 | + - id: "c" |
| 32 | + text: "ReadWriteMany is supported by DigitalOcean volumes." |
| 33 | + - id: "d" |
| 34 | + text: "The accessModes field must be set to ReadWriteOnce for DigitalOcean volumes." |
| 35 | + is_correct: true |
| 36 | + |
| 37 | + - id: "q3" |
| 38 | + text: "What happens if you try to create a PVC with a name that already exists in the cluster?" |
| 39 | + type: "single-answer" |
| 40 | + marks: 2 |
| 41 | + options: |
| 42 | + - id: "a" |
| 43 | + text: "The existing volume is deleted, and a new one is created." |
| 44 | + - id: "b" |
| 45 | + text: "An error message is returned, and the existing volume is mounted instead." |
| 46 | + is_correct: true |
| 47 | + - id: "c" |
| 48 | + text: "The cluster automatically scales to accommodate the new PVC." |
| 49 | + - id: "d" |
| 50 | + text: "The PVC creation proceeds without any issues." |
| 51 | + |
| 52 | + - id: "q4" |
| 53 | + text: "Which of the following can be customized in the volumeClaimTemplates section of a StatefulSet configuration? (Select all that apply)" |
| 54 | + type: "multiple-answers" |
| 55 | + marks: 2 |
| 56 | + options: |
| 57 | + - id: "a" |
| 58 | + text: "The name of the volume" |
| 59 | + is_correct: true |
| 60 | + - id: "b" |
| 61 | + text: "The accessModes of the volume" |
| 62 | + is_correct: true |
| 63 | + - id: "c" |
| 64 | + text: "The storage size of the volume" |
| 65 | + is_correct: true |
| 66 | + - id: "d" |
| 67 | + text: "The image used by the container" |
| 68 | + |
| 69 | + - id: "q5" |
| 70 | + text: "What is the primary purpose of a PersistentVolumeClaim (PVC) in a Kubernetes cluster?" |
| 71 | + type: "single-answer" |
| 72 | + marks: 2 |
| 73 | + options: |
| 74 | + - id: "o1" |
| 75 | + text: "To manage network policies" |
| 76 | + is_correct: false |
| 77 | + - id: "o2" |
| 78 | + text: "To create and access persistent storage" |
| 79 | + is_correct: true |
| 80 | + - id: "o3" |
| 81 | + text: "To configure load balancers" |
| 82 | + is_correct: false |
| 83 | + - id: "o4" |
| 84 | + text: "To deploy container images" |
| 85 | + is_correct: false |
| 86 | + correct_answer: "o2" |
| 87 | + |
| 88 | + - id: "q6" |
| 89 | + text: "Which Kubernetes command-line tool is used to create and manage volumes in a cluster?" |
| 90 | + type: "single-answer" |
| 91 | + marks: 1 |
| 92 | + options: |
| 93 | + - id: "o1" |
| 94 | + text: "kubeadm" |
| 95 | + is_correct: false |
| 96 | + - id: "o2" |
| 97 | + text: "kubectl" |
| 98 | + is_correct: true |
| 99 | + - id: "o3" |
| 100 | + text: "kubelet" |
| 101 | + is_correct: false |
| 102 | + - id: "o4" |
| 103 | + text: "kubectx" |
| 104 | + is_correct: false |
| 105 | + correct_answer: "o2" |
| 106 | + |
| 107 | + - id: "q7" |
| 108 | + text: "Which of the following are valid `accessModes` for DigitalOcean volumes in a Kubernetes cluster? (Select all that apply)" |
| 109 | + type: "multiple-answers" |
| 110 | + marks: 3 |
| 111 | + multiple_answers: true |
| 112 | + options: |
| 113 | + - id: "o1" |
| 114 | + text: "ReadWriteOnce" |
| 115 | + is_correct: true |
| 116 | + - id: "o2" |
| 117 | + text: "ReadOnlyMany" |
| 118 | + is_correct: false |
| 119 | + - id: "o3" |
| 120 | + text: "ReadWriteMany" |
| 121 | + is_correct: false |
| 122 | + - id: "o4" |
| 123 | + text: "WriteOnlyOnce" |
| 124 | + is_correct: false |
| 125 | + correct_answer: "o1" |
| 126 | + |
| 127 | + - id: "q8" |
| 128 | + text: "What happens if you delete a deployment in Kubernetes without removing its associated PVCs? Will the data in your volume be **preserved** or **deleted**? (Instructions: Provide a brief explanation, including one and only one of the bold keywords.)" |
| 129 | + type: "short_answer" |
| 130 | + marks: 2 |
| 131 | + #correct_answer: "The PVCs remain and must be manually deleted using `kubectl delete pvc`." |
| 132 | + correct_answer: "preserved" |
| 133 | + |
| 134 | + - id: "q9" |
| 135 | + text: "Explain the role of a `StatefulSet` in managing volumes for pods in a Kubernetes cluster." |
| 136 | + type: "essay" |
| 137 | + marks: 5 |
| 138 | + correct_answer: "A StatefulSet ensures stable, unique network identifiers and persistent storage for pods, making it ideal for applications requiring consistent data persistence. It manages the lifecycle of pods and their associated volumes, ensuring that each pod retains its identity and storage (via PVCs) even after restarts or rescheduling. In the context of volumes, a StatefulSet uses `volumeClaimTemplates` to automatically create and associate PVCs with each pod, simplifying the process of provisioning persistent storage." |
| 139 | + |
| 140 | + - id: "q10" |
| 141 | + text: "Which storage class is specified in the example configuration for a DigitalOcean volume?" |
| 142 | + type: "single-answer" |
| 143 | + marks: 1 |
| 144 | + options: |
| 145 | + - id: "o1" |
| 146 | + text: "do-block-storage" |
| 147 | + is_correct: true |
| 148 | + - id: "o2" |
| 149 | + text: "standard" |
| 150 | + is_correct: false |
| 151 | + - id: "o3" |
| 152 | + text: "premium" |
| 153 | + is_correct: false |
| 154 | + - id: "o4" |
| 155 | + text: "local-storage" |
| 156 | + is_correct: false |
| 157 | + correct_answer: "o1" |
| 158 | + |
| 159 | + - id: "q11" |
| 160 | + text: "What is the valid range for the storage size of a DigitalOcean volume in a Kubernetes cluster?" |
| 161 | + type: "short_answer" |
| 162 | + marks: 2 |
| 163 | + correct_answer: "1 GB to 10,000 GB" |
| 164 | + |
| 165 | + - id: "q12" |
| 166 | + text: "Which of the following components in the example `StatefulSet` configuration mounts the volume at `/data`? (Select all that apply)" |
| 167 | + type: "multiple-answers" |
| 168 | + marks: 3 |
| 169 | + multiple_answers: true |
| 170 | + options: |
| 171 | + - id: "o1" |
| 172 | + text: "volumeMounts" |
| 173 | + is_correct: true |
| 174 | + - id: "o2" |
| 175 | + text: "volumeClaimTemplates" |
| 176 | + is_correct: false |
| 177 | + - id: "o3" |
| 178 | + text: "spec.template.spec.containers" |
| 179 | + is_correct: true |
| 180 | + - id: "o4" |
| 181 | + text: "serviceName" |
| 182 | + is_correct: false |
| 183 | + correct_answer: "o1,o3" |
| 184 | + |
| 185 | + - id: "q13" |
| 186 | + text: "What command can you use to resize a volume by editing its PVC?" |
| 187 | + type: "short_answer" |
| 188 | + marks: 2 |
| 189 | + correct_answer: "kubectl edit pvc <pvc-name>" |
| 190 | + |
| 191 | + - id: "q14" |
| 192 | + text: "Why might a PVC deletion stall or fail in a Kubernetes cluster?" |
| 193 | + type: "short_answer" |
| 194 | + marks: 5 |
| 195 | + correct_answer: "fail" |
| 196 | + #correct_answer: "A PVC deletion may stall or fail if the associated volume is deleted manually before the PVC API object is removed using `kubectl`. This creates an inconsistent state where the PVC is still referenced but the underlying volume no longer exists. To resolve this, you can list volume attachments with `kubectl get volumeattachments`, describe the attachment with `kubectl describe volumeattachments <volume-name>`, edit it to remove the `external-attacher` finalizer, and then delete the PVC with `kubectl delete pvc <pvc-name>`." |
| 197 | + |
| 198 | + - id: "q15" |
| 199 | + text: "Which container image is used in the example `StatefulSet` configuration?" |
| 200 | + type: "single-answer" |
| 201 | + marks: 1 |
| 202 | + options: |
| 203 | + - id: "o1" |
| 204 | + text: "nginx" |
| 205 | + is_correct: false |
| 206 | + - id: "o2" |
| 207 | + text: "busybox" |
| 208 | + is_correct: true |
| 209 | + - id: "o3" |
| 210 | + text: "postgres" |
| 211 | + is_correct: false |
| 212 | + - id: "o4" |
| 213 | + text: "redis" |
| 214 | + is_correct: false |
| 215 | + correct_answer: "o2" |
| 216 | + |
| 217 | + - id: "q16" |
| 218 | + text: "What is the default filesystem owner of a volume in DigitalOcean Kubernetes?" |
| 219 | + type: "short_answer" |
| 220 | + marks: 2 |
| 221 | + correct_answer: "root" |
| 222 | + |
| 223 | + - id: "q17" |
| 224 | + text: "Which of the following `mountOptions` are supported by DigitalOcean Kubernetes for setting volume permissions? (Select all that apply)" |
| 225 | + type: "multiple-answers" |
| 226 | + marks: 3 |
| 227 | + multiple_answers: true |
| 228 | + options: |
| 229 | + - id: "o1" |
| 230 | + text: "dir_mode=0777" |
| 231 | + is_correct: false |
| 232 | + - id: "o2" |
| 233 | + text: "file_mode=0777" |
| 234 | + is_correct: false |
| 235 | + - id: "o3" |
| 236 | + text: "chmod 777 via initContainer" |
| 237 | + is_correct: true |
| 238 | + - id: "o4" |
| 239 | + text: "chown via securityContext" |
| 240 | + is_correct: true |
| 241 | + correct_answer: "o3,o4" |
| 242 | + |
| 243 | + - id: "q18" |
| 244 | + text: "What command lists the persistent volumes associated with a Kubernetes cluster?" |
| 245 | + type: "short_answer" |
| 246 | + marks: 2 |
| 247 | + correct_answer: "kubectl get pv" |
| 248 | + |
| 249 | + |
| 250 | + - id: "q19" |
| 251 | + text: "What is the consequence of modifying cluster resources like volumes directly in the DigitalOcean Control Panel?" |
| 252 | + type: "single-answer" |
| 253 | + marks: 2 |
| 254 | + options: |
| 255 | + - id: "o1" |
| 256 | + text: "It improves cluster performance" |
| 257 | + is_correct: false |
| 258 | + - id: "o2" |
| 259 | + text: "It may render resources unusable or trigger replacement" |
| 260 | + is_correct: true |
| 261 | + - id: "o3" |
| 262 | + text: "It automatically updates the PVC" |
| 263 | + is_correct: false |
| 264 | + - id: "o4" |
| 265 | + text: "It has no impact on the cluster" |
| 266 | + is_correct: false |
| 267 | + correct_answer: "o2" |
| 268 | +--- |
0 commit comments