0
0
Kubernetesdevops~10 mins

Service accounts 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 create a service account named 'my-service' in Kubernetes.

Kubernetes
kubectl create serviceaccount [1]
Drag options to blanks, or click blank then click option'
Amy-service
Bdefault
Cadmin
Dkube-system
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'default' which is the default service account, not creating a new one.
Using namespace names like 'kube-system' instead of a service account name.
2fill in blank
medium

Complete the command to list all service accounts in the 'dev' namespace.

Kubernetes
kubectl get serviceaccounts -n [1]
Drag options to blanks, or click blank then click option'
Adefault
Bprod
Ckube-system
Ddev
Attempts:
3 left
💡 Hint
Common Mistakes
Using the default namespace instead of 'dev'.
Confusing namespaces like 'prod' or 'kube-system'.
3fill in blank
hard

Fix the error in the command to delete the service account named 'test-account' in the 'test' namespace.

Kubernetes
kubectl delete serviceaccount [1] -n test
Drag options to blanks, or click blank then click option'
Atest-account-1
Btest_account
Ctest-account
Ddefault
Attempts:
3 left
💡 Hint
Common Mistakes
Using underscores instead of dashes.
Using a different service account name.
4fill in blank
hard

Fill both blanks to create a service account named 'build-bot' in the 'ci' namespace and then get its details.

Kubernetes
kubectl create serviceaccount [1] -n [2]
kubectl get serviceaccount [1] -n [2] -o yaml
Drag options to blanks, or click blank then click option'
Abuild-bot
Bci
Cdefault
Dprod
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing namespaces between commands.
Using wrong service account names.
5fill in blank
hard

Fill all three blanks to create a service account 'deploy-sa' in namespace 'staging', patch it to add an image pull secret 'reg-secret', and then describe it.

Kubernetes
kubectl create serviceaccount [1] -n [2]
kubectl patch serviceaccount [1] -n [2] -p '{"imagePullSecrets": [{"name": "[3]"}]}'
kubectl describe serviceaccount [1] -n [2]
Drag options to blanks, or click blank then click option'
Adeploy-sa
Bstaging
Creg-secret
Ddefault
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong secret names or namespaces.
Forgetting to patch the service account before describing.