Hello - have a question for ckad lighting lab -2 Q.3. The solution is asking to . . .

Nat Kus:
Hello - have a question for ckad lighting lab -2 Q.3. The solution is asking to add a toleration when there is no taint on controlplane node - is this correct and why?

Create a pod called my-busybox in the dev2406 namespace using the busybox image. The container should be called secret and should sleep for 3600 seconds.

The container should mount a read-only secret volume called secret-volume at the path /etc/secret-volume. The secret being mounted has already been created for you and is called dotfile-secret.

Make sure that the pod is scheduled on controlplane and no other node in the cluster.

k get no controlplane | grep -i Taint
Taints: none

Solution has:

 nodeSelector:
    <http://kubernetes.io/hostname|kubernetes.io/hostname>: controlplane
  tolerations:
  - key: "<http://node-role.kubernetes.io/master|node-role.kubernetes.io/master>"
    operator: "Exists"
    effect: "NoSchedule"

Marko Eremija:
This taint was there before, but it seems it has been deprecated: https://kubernetes.io/docs/reference/labels-annotations-taints/#node-role-kubernetes-io-master-taint

Nat Kus:
Thank you - hopefully kodekloud fix the solution

mjv:
this change was introduced somewhere between 1.24.0 and 1.25.0

mjv:
also,you can use tolerations without key defined

tolerations:
- operator: "Exists"
  effect: "NoSchedule"

and it will match all keys

Alistair Mackay:
The solution to that lab is a bit out of date. The lab used to be a 2 node cluster, but now it is only a single node. A more up to date solution is here
https://github.com/kodekloudhub/certified-kubernetes-application-developer-course/blob/main/docs/12-Lightning-Labs/03-Lightning-Lab-2.md