0
0
Kubernetesdevops~10 mins

Why Secrets manage sensitive data in Kubernetes - Test Your Understanding

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

Complete the code to create a Kubernetes Secret with a password.

Kubernetes
kubectl create secret generic mysecret --from-literal=password=[1]
Drag options to blanks, or click blank then click option'
Amypassword123
Bpassword123
C123456
Dsecretpass
Attempts:
3 left
💡 Hint
Common Mistakes
Using an empty password
Including spaces in the password
Using invalid characters
2fill in blank
medium

Complete the code to view the Secret data in base64 encoding.

Kubernetes
kubectl get secret mysecret -o [1]
Drag options to blanks, or click blank then click option'
Ajsonpath='{.data.password}'
Byaml
Cjson
Djsonpath='{.data}'
Attempts:
3 left
💡 Hint
Common Mistakes
Using -o yaml shows base64 encoded data for all keys
Using wrong jsonpath expression
Not specifying output format
3fill in blank
hard

Fix the error in the command to decode the Secret password.

Kubernetes
echo [1] | base64 --decode
Drag options to blanks, or click blank then click option'
Akubectl get secret mysecret -o jsonpath='{.data.password}'
Bkubectl get secret mysecret -o yaml
Ckubectl get secret mysecret -o json
Dkubectl get secret mysecret
Attempts:
3 left
💡 Hint
Common Mistakes
Piping whole yaml or json output
Not using base64 decode
Missing quotes in jsonpath
4fill in blank
hard

Fill both blanks to create a Secret from a file and list all Secrets.

Kubernetes
kubectl create secret generic mysecret --from-file=[1] && kubectl [2] secrets
Drag options to blanks, or click blank then click option'
Aconfig.txt
Bget
Clist
Ddescribe
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong kubectl verbs
Using wrong file names
Confusing list and get
5fill in blank
hard

Fill all three blanks to patch a Secret with a new key and value.

Kubernetes
kubectl patch secret mysecret -p '{{"data":{{"[1]": "[2]"}}}}' && kubectl get secret mysecret -o [3]
Drag options to blanks, or click blank then click option'
AapiKey
BYXBpa2V5MTIz
Cjson
Dpassword
Attempts:
3 left
💡 Hint
Common Mistakes
Not encoding value in base64
Using wrong output format
Incorrect JSON patch syntax