Linux_Foundation
CKA · Question #11
Create a Kubernetes secret as follows: Name: super-secret password: bob Create a pod named pod-secrets-via-file, using the redis Image, which mounts a secret named super-secret at /secrets. Create a…
1. Create the Kubernetes secret (from page 4) kubectl create secret generic super-secret --from-literal=password=bob 2. Create a pod named pod-secrets-via-file (from page 5) Save the following content to a file (e.g., secret-via-file-pod.yaml): apiVersion: v1 kind: Pod…
Submitted by helene.fr· May 4, 2026Workloads and Scheduling
Question
Create a Kubernetes secret as follows:
Name: super-secret
password: bob
Create a pod named pod-secrets-via-file, using the redis Image, which mounts a secret named super-secret at /secrets.
Create a second pod named pod-secrets-via-env, using the redis Image, which exports password as CONFIDENTIAL
Explanation
1. Create the Kubernetes secret (from page 4)
kubectl create secret generic super-secret --from-literal=password=bob
2. Create a pod named pod-secrets-via-file (from page 5)
Save the following content to a file (e.g., secret-via-file-pod.yaml):
apiVersion: v1 kind: Pod metadata: name: pod-secrets-via-file spec: containers:
- name: redis
image: redis
volumeMounts:
- name: foo mountPath: "/secrets" volumes:
- name: foo secret: secretName: super-secret
Then apply it: kubectl apply -f secret-via-file-pod.yaml
3. Create a second pod named pod-secrets-via-env
The solution for this part (pod-secrets-via-env) is not provided in the given images.
Topics
#Kubernetes Secrets#Pod configuration#Volume mounts#Environment variables
Community Discussion
No community discussion yet for this question.