0
0
Kubernetesdevops~10 mins

Creating Secrets in Kubernetes - Interactive Practice

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

Complete the command to create a generic secret named mysecret with a literal key-value pair.

Kubernetes
kubectl create secret generic mysecret --from-literal=[1]
Drag options to blanks, or click blank then click option'
Afile=secret.txt
Bpassword
Cusername=admin
Dtype=opaque
Attempts:
3 left
💡 Hint
Common Mistakes
Providing only a key without a value.
Using a file name instead of a key=value pair.
2fill in blank
medium

Complete the command to create a secret from a file named config.json.

Kubernetes
kubectl create secret generic config-secret --from-file=[1]
Drag options to blanks, or click blank then click option'
Aconfig.yaml
Bconfig.json
Csecret.txt
Ddata.txt
Attempts:
3 left
💡 Hint
Common Mistakes
Using a file name that does not exist.
Confusing file extensions.
3fill in blank
hard

Fix the error in the command to create a secret named db-secret with a literal password.

Kubernetes
kubectl create secret generic db-secret --from-literal=[1]
Drag options to blanks, or click blank then click option'
Apassword=12345
Bpassword
C12345
Dpass=12345
Attempts:
3 left
💡 Hint
Common Mistakes
Providing only the key or only the value.
Using an incorrect key name.
4fill in blank
hard

Fill both blanks to create a secret named api-secret from a file and specify the secret type as kubernetes.io/basic-auth.

Kubernetes
kubectl create secret generic api-secret --from-file=[1] --type=[2]
Drag options to blanks, or click blank then click option'
Aauth.txt
Bopaque
Ckubernetes.io/basic-auth
Dconfig.json
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong file name.
Setting the secret type incorrectly.
5fill in blank
hard

Fill all three blanks to create a secret named token-secret from a literal token, specify the namespace dev, and set the secret type to Opaque.

Kubernetes
kubectl create secret generic token-secret --from-literal=[1] --namespace=[2] --type=[3]
Drag options to blanks, or click blank then click option'
Atoken=abc123
Bdev
COpaque
Ddefault
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting the namespace option.
Using the wrong secret type.
Providing only the token value without a key.