Understanding UID and GID from SecurityContext
A pod is running with the following SecurityContext: securityContext: runAsUser: 1000 runAsGroup: 2000 fsGroup: 3000 What UID and GID does the process inside the container use?
Quick Answer
The answer is UID 1000 and GID 2000 for the process inside the container. This is because the `runAsUser` and `runAsGroup` fields in the SecurityContext directly control the user and group identity of the main container process, overriding any default image settings. The `fsGroup` field, set to 3000 here, only affects the group ownership of any volumes mounted into the pod, not the process’s primary GID. On the CKAD exam, this distinction is a frequent trap: candidates often confuse `fsGroup` with the process group, but the exam tests your understanding that `runAsUser` and `runAsGroup` are the sole determinants of the process’s UID and GID. A reliable memory tip is to think of “run” as the active process identity, while “fs” stands for filesystem ownership only—so the process runs with the “run” values, not the “fs” values.
⚠ Common exam trap
Watch out — candidates often confuse `fsGroup` with the process's primary GID, thinking it overrides `runAsGroup`, when in fact `fsGroup` only affects volume group ownership and does not change the process's GID.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
UID 1000, GID 2000
The `runAsUser` and `runAsGroup` fields in the Pod's SecurityContext directly set the UID and GID for the container's main process. Here, `runAsUser: 1000` sets the process UID to 1000, and `runAsGroup: 2000` sets the process GID to 2000. The `fsGroup: 3000` field only applies to the group ownership of mounted volumes, not to the process's primary GID.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
UID 1000, GID 3000
Why it's wrong here
fsGroup sets the group for volumes, not the process primary GID.
- ✓
UID 1000, GID 2000
Why this is correct
runAsUser sets UID, runAsGroup sets GID. Both apply to the container process.
- ✗
UID 0, GID 2000
Why it's wrong here
runAsUser is specified as 1000, so UID is not 0.
- ✗
UID 3000, GID 2000
Why it's wrong here
fsGroup does not affect the UID of the container process.
Go deeper
Related to this question
About these practice questions
One of 160 original CKAD practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on CKAD
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A pod manifest includes the following securityContext: securityContext: { runAsUser: 1000, runAsGroup: 3000, fsGroup: 2000 }. What UID will be used for processes in the container?
medium- A.0 (root)
- B.3000
- C.2000
- ✓ D.1000
Why D: The `runAsUser` field in the pod's securityContext explicitly sets the user ID (UID) for all processes in the container. In this manifest, `runAsUser: 1000` overrides the default UID (usually 0, root) and ensures that the container's main process runs with UID 1000. The `runAsGroup` and `fsGroup` fields affect group IDs and file ownership, not the process UID.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This CKAD practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CKAD exam.