Certified Kubernetes Application Developer (CKAD) · Free practice question 3 of 12
fsGroup for shared volume ownership
Containers at Lanhydrock Studio run as UID 1001 and must write to a mounted volume whose files are owned by root. The storage driver supports ownership management. Which Pod-level setting makes the volume group-writable for the containers?
- A.securityContext: {seLinuxOptions: {level: s0}}
- B.securityContext: {runAsGroup: 0}
- C.securityContext: {fsGroup: 2000}
- D.securityContext: {supplementalGroups: [0], readOnlyRootFilesystem: true}
Show answer and explanation
Correct answer: C. securityContext: {fsGroup: 2000}
Why: fsGroup makes the kubelet change group ownership of supported volumes to that GID, set group write permissions, and add the GID to the container processes, so non-root containers can write. Running with group 0 grants root-group access but does not change volume ownership. readOnlyRootFilesystem is a container field and makes things less writable, and SELinux levels do not alter POSIX ownership.
More free Certified Kubernetes Application Developer (CKAD) questions
- Generating a Pod manifest skeleton
- Downward API Pod IP as env
- Indexed Job completion index
- Pulling and unpacking a chart locally
- Kustomize namePrefix and references
- Watching Pod status changes live
- tcpSocket probe for a non-HTTP server
- ExternalName Service for an outside host
- StatefulSet per-Pod DNS name
- Ways to consume a Secret in a container
- Checking quota usage in a namespace