Linux_FoundationLinux_Foundation
CKA · Question #12
CKA Question #12: Real Exam Question with Answer & Explanation
``bash Create the YAML file for the pod vim volume.yaml Paste the following content into volume.yaml ` `yaml apiVersion: v1 kind: Pod metadata: name: non-persistent-redis namespace: staging spec: containers: - name: non-persistent-redis image: redis volumeMounts: - name: cache-co
Submitted by khalil_dz· May 4, 2026Storage
Question
Create a pod as follows: Name: non-persistent-redis Container image: redis Volume with name: cache-control Mount path: /data/redis The pod should launch in the staging namespace and the volume must not be persistent.
Explanation
# Create the YAML file for the pod
vim volume.yaml
# Paste the following content into volume.yaml
apiVersion: v1
kind: Pod
metadata:
name: non-persistent-redis
namespace: staging
spec:
containers:
- name: non-persistent-redis
image: redis
volumeMounts:
- name: cache-control
mountPath: /data/redis
volumes:
- name: cache-control
emptyDir: {}
# Save and exit vim.
# Create the pod
kubectl create -f volume.yaml
# Verify the pod is running in the 'staging' namespace
kubectl get pod non-persistent-redis -n staging
Topics
#Pod creation#emptyDir volume#Namespace#Volume mounts
Community Discussion
No community discussion yet for this question.