Recall & Review
beginner
What is a Kubernetes Secret?
A Kubernetes Secret is a way to store and manage sensitive information, like passwords or keys, separately from application code. It helps keep secrets safe and out of plain sight.
Click to reveal answer
beginner
How do you create a secret from literal values using kubectl?
Use the command: <br>
kubectl create secret generic my-secret --from-literal=username=admin --from-literal=password=12345<br>This creates a secret named 'my-secret' with username and password stored.Click to reveal answer
intermediate
What is the difference between 'generic' and 'docker-registry' secret types?
'generic' is for general secrets like passwords or tokens.<br>'docker-registry' is specifically for storing Docker registry credentials to pull private images.
Click to reveal answer
beginner
How can you create a secret from a file?
Use the command:<br>
kubectl create secret generic my-secret --from-file=path/to/file<br>This stores the file content as a secret value.Click to reveal answer
beginner
Why should secrets not be stored in plain text in configuration files?
Storing secrets in plain text risks exposing sensitive data if files are shared or accessed by unauthorized users. Using Kubernetes Secrets helps keep them encoded and managed securely.
Click to reveal answer
Which command creates a Kubernetes secret from literal values?
✗ Incorrect
The correct syntax is 'kubectl create secret generic' followed by the secret name and '--from-literal' options.
What type of secret is used to store Docker registry credentials?
✗ Incorrect
'docker-registry' type is designed specifically for Docker registry credentials.
How can you create a secret from a file named 'config.txt'?
✗ Incorrect
The correct command uses '--from-file' to create a secret from a file.
Why is it better to use Kubernetes Secrets instead of storing passwords in plain text files?
✗ Incorrect
Kubernetes Secrets help keep sensitive data encoded and managed securely, unlike plain text files.
Which command shows the details of a secret in Kubernetes?
✗ Incorrect
'kubectl describe secret' shows detailed information about the secret.
Explain how to create a Kubernetes secret from literal values and why it is useful.
Think about commands and the purpose of secrets.
You got /4 concepts.
Describe the difference between generic secrets and docker-registry secrets in Kubernetes.
Consider what each secret type stores.
You got /4 concepts.