0
0
Kubernetesdevops~5 mins

Creating Secrets in Kubernetes - Quick Revision & Summary

Choose your learning style9 modes available
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?
Akubectl create secret generic my-secret --from-literal=key=value
Bkubectl apply secret my-secret --from-literal=key=value
Ckubectl secret create my-secret --literal=key=value
Dkubectl secret generic create my-secret --from-literal=key=value
What type of secret is used to store Docker registry credentials?
Atls
Bgeneric
Cdocker-registry
Dopaque
How can you create a secret from a file named 'config.txt'?
Akubectl create secret generic my-secret --from-file=config.txt
Bkubectl create secret file my-secret config.txt
Ckubectl secret create my-secret --file=config.txt
Dkubectl apply secret generic my-secret --file=config.txt
Why is it better to use Kubernetes Secrets instead of storing passwords in plain text files?
APlain text files are more secure.
BSecrets are automatically encrypted and managed securely.
CSecrets are visible to all users by default.
DPlain text files are faster to access.
Which command shows the details of a secret in Kubernetes?
Akubectl secret info my-secret
Bkubectl get secret my-secret -o yaml
Ckubectl show secret my-secret
Dkubectl describe secret my-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.