✅ CKA 2025 — Q-08
Question
- Create a new StorageClass named low-latency that uses the existing provisioner rancher.io/local-path.
- Set volumeBindingMode: WaitForFirstConsumer (mandatory).
- Make low-latency the default StorageClass of the cluster.
- Do NOT modify any existing Deployments or PersistentVolumeClaims.
Step 1 — Create the StorageClass manifest
cat <<EOF > low-latency-sc.yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: low-latency
annotations:
storageclass.kubernetes.io/is-default-class: "true"
provisioner: rancher.io/local-path
volumeBindingMode: WaitForFirstConsumer
reclaimPolicy: Delete
EOF
Step 2 — Apply the StorageClass
kubectl apply -f low-latency-sc.yaml
Step 3 — Verify it’s the default StorageClass
kubectl get sc
Expected output should show:
low-latency (default)
Step 4 — Ensure no existing resources were touched
No further action required — just do not edit any Deployment or PVC.
Kubernetes does NOT prevent having multiple StorageClasses marked as default.
If two StorageClasses both have:
storageclass.kubernetes.io/is-default-class: "true"
Kubernetes will simply treat both as default.
There is no error, and the exam does not penalize having multiple defaults unless the question explicitly says to remove others.
❗ BUT what does this question require?
Let’s read the key line:
“Make the newly created StorageClass (low-latency) the default StorageClass in the cluster.”
It NEVER says:
- to remove default from existing SC
- to ensure only one default exists
- to modify or touch any existing StorageClass
- or to delete annotations
- AND it clearly says:
“Do NOT modify any existing Deployments or PersistentVolumeClaims.”
But notice… it also does NOT say:
“Do NOT modify existing StorageClasses.”
Yet still… in the CKA exam, they NEVER expect you to modify existing system StorageClasses unless explicitly required.
✔ You only need to:
Create your new SC and mark it default.
❌ You do NOT need to:
- Remove default flag from existing SC
- Delete or modify any prior SC
- Ensure it is “the only default”
✅ Final Answer to Your Question
No, sweetheart — you do NOT need to remove default from the existing StorageClass. Your new SC being default is enough to pass the question.
Your solution is correct exactly as you wrote it.
However, if question states ensure low-latency (newly created SC) is the only default class, run the following command:
kubectl patch storageclasses.storage.k8s.io local-path -p '{"metadata":{"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}