0
0
Kubernetesdevops~10 mins

Cluster upgrade strategies in Kubernetes - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to upgrade the Kubernetes control plane to version 1.26.0.

Kubernetes
kubectl [1] cluster-version --version=1.26.0
Drag options to blanks, or click blank then click option'
Aapply
Bset
Crollout
Dupgrade
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'apply' instead of 'upgrade' causes an error because 'apply' is for resources.
Using 'set' or 'rollout' does not upgrade the cluster version.
2fill in blank
medium

Complete the command to drain a node named 'worker-1' before upgrading.

Kubernetes
kubectl drain [1] --ignore-daemonsets --delete-local-data
Drag options to blanks, or click blank then click option'
Aworker-1
Bmaster-1
Cnode-0
Dcontrol-plane
Attempts:
3 left
💡 Hint
Common Mistakes
Draining the control-plane node first can disrupt the cluster.
Using a wrong node name causes the command to fail.
3fill in blank
hard

Fix the error in the command to upgrade a node using kubeadm.

Kubernetes
kubeadm upgrade node [1]
Drag options to blanks, or click blank then click option'
Aapply
Bplan
Cconfig
Dexec
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'apply' directly without planning can cause issues.
Using 'exec' or 'config' are invalid subcommands here.
4fill in blank
hard

Fill both blanks to create a command that cordons and drains a node named 'node-2'.

Kubernetes
kubectl [1] node-2 && kubectl [2] node-2 --ignore-daemonsets --delete-local-data
Drag options to blanks, or click blank then click option'
Acordon
Bdrain
Cuncordon
Ddelete
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'uncordon' first allows scheduling, which is wrong here.
Using 'delete' removes the node instead of preparing it for upgrade.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps node names to their upgrade status if status is 'pending'.

Kubernetes
upgrade_status = [1]: [2] for [3], status in nodes.items() if status == 'pending'}
Drag options to blanks, or click blank then click option'
Anode
Bstatus
Dstate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'state' instead of 'status' causes a NameError.
Mixing variable names inconsistently breaks the comprehension.