0
0
Kubernetesdevops~5 mins

Using Secrets as mounted volumes in Kubernetes - Cheat Sheet & Quick Revision

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, tokens, or keys securely within a cluster.
Click to reveal answer
beginner
How do you use a Secret as a mounted volume in a pod?
You define a volume in the pod spec that uses the Secret, then mount that volume into a container's file system at a specific path.
Click to reveal answer
intermediate
What is the benefit of mounting Secrets as volumes instead of environment variables?
Mounting Secrets as volumes allows the container to read secret data as files, which can be more secure and flexible, especially for certificates or keys.
Click to reveal answer
intermediate
What happens if the Secret data changes after the pod is running?
The mounted Secret volume is updated automatically, so the container can see the new secret data without restarting the pod.
Click to reveal answer
beginner
Show a simple YAML snippet to mount a Secret named 'my-secret' as a volume at '/etc/secret'.
volumes: - name: secret-volume secret: secretName: my-secret containers: - name: my-container volumeMounts: - name: secret-volume mountPath: /etc/secret
Click to reveal answer
What Kubernetes object stores sensitive data like passwords?
AService
BSecret
CPod
DConfigMap
How do you make a Secret available inside a container as files?
AMount the Secret as a volume
BSet environment variables
CUse a ConfigMap
DAdd it to the container image
If a Secret changes, how does the mounted volume behave?
AIt updates automatically
BIt stays the same until pod restart
CIt deletes the pod
DIt crashes the container
Which path is commonly used to mount Secrets as volumes?
A/var/log
B/usr/bin
C/etc/secret
D/home/user
What is the key difference between Secrets and ConfigMaps?
AConfigMaps are encrypted by default
BConfigMaps store sensitive data, Secrets do not
CSecrets are only for environment variables
DSecrets store sensitive data, ConfigMaps do not
Explain how to mount a Kubernetes Secret as a volume inside a pod and why you might do this.
Think about how files inside a container can hold secret data securely.
You got /4 concepts.
    Describe what happens when the data in a Kubernetes Secret changes while a pod is running with that Secret mounted as a volume.
    Consider how Kubernetes keeps the secret data fresh inside the container.
    You got /4 concepts.