0
0
Kubernetesdevops~10 mins

Kubernetes dashboard - Interactive Code Practice

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

Complete the command to start the Kubernetes dashboard proxy.

Kubernetes
kubectl [1] proxy
Drag options to blanks, or click blank then click option'
Aproxy
Brun
Ccreate
Dapply
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'create' or 'apply' instead of 'proxy' will not start the proxy server.
Trying to use 'run' will cause an error because it is for running pods.
2fill in blank
medium

Complete the command to deploy the Kubernetes dashboard using the official YAML file.

Kubernetes
kubectl apply -f [1]
Drag options to blanks, or click blank then click option'
Adashboard-config.yaml
Bhttps://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml
Cdashboard.json
Ddashboard.yaml
Attempts:
3 left
💡 Hint
Common Mistakes
Using a local file name will fail if the file does not exist.
Using JSON files is incorrect because Kubernetes uses YAML for manifests.
3fill in blank
hard

Fix the error in the command to get the dashboard login token for the 'kubernetes-dashboard' service account in the 'kubernetes-dashboard' namespace.

Kubernetes
kubectl -n kubernetes-dashboard get secret [1] -o go-template='{{.data.token | base64decode}}'
Drag options to blanks, or click blank then click option'
Aadmin-user-token
Bdefault-token
C$(kubectl -n kubernetes-dashboard get sa kubernetes-dashboard -o jsonpath='{.secrets[0].name}')
Dkubernetes-dashboard-token
Attempts:
3 left
💡 Hint
Common Mistakes
Using a fixed secret name may fail if the secret name changes.
Not using command substitution will cause the command to fail.
4fill in blank
hard

Fill both blanks to create a ClusterRoleBinding named 'dashboard-admin' that binds the 'cluster-admin' role to the 'kubernetes-dashboard' service account in the 'kubernetes-dashboard' namespace.

Kubernetes
kubectl create clusterrolebinding dashboard-admin --clusterrole=[1] --serviceaccount=[2]
Drag options to blanks, or click blank then click option'
Acluster-admin
Badmin
Ckubernetes-dashboard:kubernetes-dashboard
Ddefault:default
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'admin' instead of 'cluster-admin' will not grant full permissions.
Not specifying the namespace in the service account will cause errors.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps pod names to their status phase for pods in the 'kubernetes-dashboard' namespace where the phase is 'Running'.

Kubernetes
pods_status = { [1]: pod.status.phase for pod in [3].items if pod.status.phase == '[2]' }
Drag options to blanks, or click blank then click option'
Apod.metadata.name
BRunning
Cpods
Dpod.metadata.labels
Attempts:
3 left
💡 Hint
Common Mistakes
Using labels instead of name as key will not give pod names.
Filtering with wrong phase will give incorrect results.