0
0
Kubernetesdevops~10 mins

Multi-cluster management concept in Kubernetes - Interactive Code Practice

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

Complete the code to list all contexts in your kubeconfig file.

Kubernetes
kubectl config get-contexts [1]
Drag options to blanks, or click blank then click option'
A--no-headers
B--list
C--contexts
D--all
Attempts:
3 left
💡 Hint
Common Mistakes
Using --all which is not a valid option here
Using --contexts which is not recognized
Using --list which is not a valid flag for this command
2fill in blank
medium

Complete the command to switch to a specific cluster context named 'cluster-2'.

Kubernetes
kubectl config [1] cluster-2
Drag options to blanks, or click blank then click option'
Aswitch-context
Bset-context
Cchange-context
Duse-context
Attempts:
3 left
💡 Hint
Common Mistakes
Using set-context which configures but does not switch
Using switch-context which is not a kubectl command
Using change-context which is invalid
3fill in blank
hard

Fix the error in the command to apply a deployment to a specific cluster context.

Kubernetes
kubectl --context=[1] apply -f deployment.yaml
Drag options to blanks, or click blank then click option'
Acontext1
Bmy-cluster
Cdefault
Dcluster1
Attempts:
3 left
💡 Hint
Common Mistakes
Using cluster names instead of context names
Using 'default' which may not be the correct context
Using generic names not in kubeconfig
4fill in blank
hard

Fill in the blank to create a kubeconfig file that merges two cluster configs.

Kubernetes
kubectl config [1] --kubeconfig=config1.yaml --kubeconfig=config2.yaml --flatten > merged-config.yaml
Drag options to blanks, or click blank then click option'
Aset
Bview
Cget
Duse
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'get' instead of 'view'
Using 'use' which switches context, not merges
Using 'set' which modifies specific config elements
5fill in blank
hard

Fill all three blanks to create a context named 'prod' for cluster 'cluster-prod' with user 'admin'.

Kubernetes
kubectl config [1] prod --cluster=[2] --user=[3]
Drag options to blanks, or click blank then click option'
Aset-context
Bcluster-prod
Cadmin
Duse-context
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'use-context' which switches context but does not create
Mixing cluster and user names
Omitting required flags