Question 853 of 997
Minimize Microservice VulnerabilitieshardMultiple ChoiceObjective-mapped

Why Pod Crashes When runAsNonRoot: true But Image Runs as Root

This CKS practice question tests your understanding of minimize microservice vulnerabilities. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A pod is running with the following security context:

```yaml securityContext: allowPrivilegeEscalation: false runAsNonRoot: true seccompProfile: type: RuntimeDefault ```

The pod is in a CrashLoopBackOff. The logs show: "exec user process caused: operation not permitted". What is the most likely cause?

Clue words in this question

Noticing these words before you look at the options changes how you read each choice.

  • Clue: "most likely"

    Why it matters: Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.

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

The container image is set to run as root, which conflicts with runAsNonRoot.

The error 'operation not permitted' when the container tries to execute its entrypoint indicates that the binary inside the image requires root privileges to run, but the security context's `runAsNonRoot: true` forces the container to run with a non-root user (typically UID != 0). This conflict prevents the process from starting, causing the CrashLoopBackOff. The `runAsNonRoot` field enforces that the container's user ID must not be 0, and if the image's default user is root, the container runtime will reject execution.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • The container image is set to run as root, which conflicts with runAsNonRoot.

    Why this is correct

    runAsNonRoot: true requires the container to run as a non-root user. If the image defaults to root, the container fails to start.

    Clue confirmation

    The clue word "most likely" in the question point toward this answer.

    Related concept

    Read the scenario before looking for a memorised answer.

  • The container is missing the CAP_SYS_ADMIN capability.

    Why it's wrong here

    The error is about the user, not capabilities.

  • The allowPrivilegeEscalation: false prevents the container from starting.

    Why it's wrong here

    allowPrivilegeEscalation: false is a security measure but does not prevent the container from starting; it only prevents gaining additional privileges.

  • The seccomp profile is blocking necessary system calls.

    Why it's wrong here

    The RuntimeDefault profile allows typical syscalls; it is unlikely to cause an operation not permitted error.

Common exam traps

Common exam trap: answer the scenario, not the keyword

Kubernetes often tests the distinction between startup-time enforcement (like `runAsNonRoot` and `runAsUser`) versus runtime enforcement (like capabilities and seccomp), leading candidates to confuse a user ID mismatch with a capability or seccomp issue.

Detailed technical explanation

How to think about this question

Under the hood, `runAsNonRoot: true` is enforced by the container runtime (e.g., containerd or CRI-O) by checking the container's primary UID before executing the entrypoint. If the image's USER directive or the default user is root (UID 0), the runtime refuses to start the container and returns an error. This is different from a capability or seccomp denial, which would occur during syscall execution, not at process launch. In real-world scenarios, this often happens with legacy images that hardcode root as the user, requiring either a securityContext `runAsUser` override or a custom image rebuild.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A security administrator must allow nursing staff to reach a patient records server while blocking access from the guest Wi-Fi VLAN. After applying an extended ACL, traffic is still blocked from nursing workstations. The ACL was applied outbound instead of inbound on the wrong interface. Questions like this test ACL direction and placement rules.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related CKS practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free CKS practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this CKS question test?

Minimize Microservice Vulnerabilities — This question tests Minimize Microservice Vulnerabilities — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: The container image is set to run as root, which conflicts with runAsNonRoot. — The error 'operation not permitted' when the container tries to execute its entrypoint indicates that the binary inside the image requires root privileges to run, but the security context's `runAsNonRoot: true` forces the container to run with a non-root user (typically UID != 0). This conflict prevents the process from starting, causing the CrashLoopBackOff. The `runAsNonRoot` field enforces that the container's user ID must not be 0, and if the image's default user is root, the container runtime will reject execution.

What should I do if I get this CKS question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Are there clue words in this question I should notice?

Yes — watch for: "most likely". Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Keep practising

More CKS practice questions

Last reviewed: Jul 4, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This CKS 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 CKS exam.