Application Environment, Configuration and Security: CKAD practice questions

Application Environment, Configuration and Security is 24% of the free CKAD mock (13 of 50 questions). Pick an answer to see right away whether it is correct, with the explanation and the documentation section it comes from.

CK.IV · CKAD practice question

A container image has default user UID 0. If you set securityContext.runAsNonRoot: true on the container without setting runAsUser to a non-zero UID, what happens?

Choose one answer
Check answer and explanation

Correct answer: Kubelet rejects starting the container because the resolved user ID is 0

Explanation

runAsNonRoot: true requires the effective UID to be non-zero; if the image defaults to UID 0 and no non-zero runAsUser is set, kubelet refuses to start the container.

Common trap

runAsNonRoot: true requires the effective UID to be non-zero; if the image defaults to UID 0 and no non-zero runAsUser is set, kubelet refuses to start the container.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.IV · CKAD practice question

A container sets readOnlyRootFilesystem: true, and the application writes temporary lock/cache files to /tmp. Which change allows /tmp to be writable while keeping the rest of the root filesystem read-only?

Choose one answer
Check answer and explanation

Correct answer: Mount an emptyDir volume at /tmp

Explanation

Mounting an emptyDir volume at /tmp gives the container a writable directory backed by ephemeral storage while keeping the root filesystem read-only.

Common trap

Mounting an emptyDir volume at /tmp gives the container a writable directory backed by ephemeral storage while keeping the root filesystem read-only.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.IV · CKAD practice question

A developer wants to run a Pod with seccompProfile set to the container runtime's default profile. Where is seccompProfile configured in a Pod manifest?

Choose one answer
Check answer and explanation

Correct answer: Under spec.securityContext.seccompProfile (or container securityContext.seccompProfile) with type: RuntimeDefault

Explanation

seccompProfile is configured in Pod or container securityContext with type: RuntimeDefault to apply the runtime's default seccomp profile.

Common trap

seccompProfile is configured in Pod or container securityContext with type: RuntimeDefault to apply the runtime's default seccomp profile.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.IV · CKAD practice question

A Pod has spec.containers[0].resources.requests.memory: 256Mi and limits.memory: 256Mi, and no CPU values set. What Quality of Service (QoS) class does Kubernetes assign to this Pod?

Choose one answer
Check answer and explanation

Correct answer: Burstable (because CPU requests/limits are omitted, even though memory request equals memory limit)

Explanation

A Pod is Guaranteed only when every container sets equal requests and limits for all resources (both CPU and memory); omitting CPU places it in Burstable.

Common trap

A Pod is Guaranteed only when every container sets equal requests and limits for all resources (both CPU and memory); omitting CPU places it in Burstable.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.IV · CKAD practice question

A Pod mounts a Secret named api-token as a file at /run/secrets/token. If you update the Secret's data in Kubernetes, what happens to the file at /run/secrets/token inside the running container?

Choose one answer
Check answer and explanation

Correct answer: Kubelet updates the mounted file asynchronously (typically within the sync period) unless subPath is used

Explanation

Kubelet periodically syncs projected Secret volumes into the container unless subPath is used, in which case updates do not propagate.

Common trap

Kubelet periodically syncs projected Secret volumes into the container unless subPath is used, in which case updates do not propagate.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.IV · CKAD practice question

How do you test whether ServiceAccount deploy-sa in namespace staging is permitted to create deployments in namespace staging?

Choose one answer
Check answer and explanation

Correct answer: kubectl auth can-i create deployments -n staging --as=system:serviceaccount:staging:deploy-sa

Explanation

kubectl auth can-i -n --as=system:serviceaccount:: evaluates RBAC authorization as that ServiceAccount.

Common trap

kubectl auth can-i -n --as=system:serviceaccount:: evaluates RBAC authorization as that ServiceAccount.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.IV · CKAD practice question

In a Kubernetes Secret YAML manifest, if you put plaintext in stringData and base64-encoded text in data, what does the API server do?

Choose one answer
Check answer and explanation

Correct answer: Decodes stringData and merges it into base64-encoded data upon creation/update

Explanation

stringData is a write-only convenience field that accepts plaintext and is automatically base64-encoded into data by the API server (and omitted when reading back the Secret).

Common trap

stringData is a write-only convenience field that accepts plaintext and is automatically base64-encoded into data by the API server (and omitted when reading back the Secret).

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.IV · CKAD practice question

In Kubernetes admission control, what is the difference between a mutating admission webhook and a validating admission webhook?

Choose one answer
Check answer and explanation

Correct answer: Mutating webhooks can modify incoming requests before validation; validating webhooks accept or reject requests without modifying them

Explanation

Mutating admission controllers run first and can alter object fields, followed by object schema validation and validating admission controllers that allow or deny requests.

Common trap

Mutating admission controllers run first and can alter object fields, followed by object schema validation and validating admission controllers that allow or deny requests.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.IV · CKAD practice question

Once you know a CustomResourceDefinition defines custom resource instances of kind BackupJob in group backup.example.com (version v1alpha1), and the plural resource name is backupjobs, which command lists all instances in namespace prod?

Choose one answer
Check answer and explanation

Correct answer: kubectl get backupjobs -n prod

Explanation

Once a CRD is registered, its custom resources are queried just like built-in resources using their plural name (kubectl get backupjobs -n prod).

Common trap

Once a CRD is registered, its custom resources are queried just like built-in resources using their plural name (kubectl get backupjobs -n prod).

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.IV · CKAD practice question

To harden a Pod that does not need to talk to the Kubernetes API server, which setting prevents automatic mounting of the ServiceAccount API token?

Choose one answer
Check answer and explanation

Correct answer: automountServiceAccountToken: false

Explanation

Setting automountServiceAccountToken: false on the Pod or ServiceAccount stops Kubernetes from automatically mounting the API token volume.

Common trap

Setting automountServiceAccountToken: false on the Pod or ServiceAccount stops Kubernetes from automatically mounting the API token volume.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.IV · CKAD practice question

What does a LimitRange of type Container with default: { cpu: '200m', memory: '128Mi' } and defaultRequest: { cpu: '100m', memory: '64Mi' } do in a namespace?

Choose one answer
Check answer and explanation

Correct answer: Injects default CPU/memory requests and limits into containers that omit them

Explanation

A Container LimitRange sets default requests and limits on newly created containers that do not specify them, and validates min/max bounds.

Common trap

A Container LimitRange sets default requests and limits on newly created containers that do not specify them, and validates min/max bounds.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.IV · CKAD practice question

Which command creates a ClusterRole named cluster-auditor that allows read-only get and list on persistentvolumes?

Choose one answer
Check answer and explanation

Correct answer: kubectl create clusterrole cluster-auditor --verb=get,list --resource=persistentvolumes

Explanation

kubectl create clusterrole creates a cluster-scoped RBAC role with the specified --verb and --resource rules.

Common trap

kubectl create clusterrole creates a cluster-scoped RBAC role with the specified --verb and --resource rules.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.IV · CKAD practice question

Which command creates a ConfigMap named app-config from a file named config.properties in namespace billing?

Choose one answer
Check answer and explanation

Correct answer: kubectl create configmap app-config --from-file=config.properties -n billing

Explanation

kubectl create configmap --from-file= creates a ConfigMap entry keyed by the filename (or key=path) containing the file's contents.

Common trap

kubectl create configmap --from-file= creates a ConfigMap entry keyed by the filename (or key=path) containing the file's contents.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.IV · CKAD practice question

Which command creates an Opaque Secret named db-creds with keys username=admin and password=s3cr3t in namespace shop?

Choose one answer
Check answer and explanation

Correct answer: kubectl create secret generic db-creds --from-literal=username=admin --from-literal=password=s3cr3t -n shop

Explanation

kubectl create secret generic creates an Opaque Secret, and --from-literal=key=value populates key-value entries directly.

Common trap

kubectl create secret generic creates an Opaque Secret, and --from-literal=key=value populates key-value entries directly.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.IV · CKAD practice question

Which command creates a ServiceAccount named ci-runner in namespace ci?

Choose one answer
Check answer and explanation

Correct answer: kubectl create serviceaccount ci-runner -n ci

Explanation

kubectl create serviceaccount -n creates a ServiceAccount resource in the target namespace.

Common trap

kubectl create serviceaccount -n creates a ServiceAccount resource in the target namespace.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.IV · CKAD practice question

Which command finds CustomResourceDefinitions installed in the cluster matching 'certificates'?

Choose one answer
Check answer and explanation

Correct answer: kubectl get crds | grep certificates

Explanation

kubectl get crds lists all CustomResourceDefinitions in the cluster and can be filtered with grep.

Common trap

kubectl get crds lists all CustomResourceDefinitions in the cluster and can be filtered with grep.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.IV · CKAD practice question

Which command lists all RoleBindings and ClusterRoleBindings in a cluster to audit who has access to a given Role or ClusterRole?

Choose one answer
Check answer and explanation

Correct answer: kubectl get rolebindings,clusterrolebindings -A

Explanation

kubectl get rolebindings,clusterrolebindings -A lists all namespaced RoleBindings and cluster-wide ClusterRoleBindings across all namespaces.

Common trap

kubectl get rolebindings,clusterrolebindings -A lists all namespaced RoleBindings and cluster-wide ClusterRoleBindings across all namespaces.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.IV · CKAD practice question

Which container securityContext setting prevents a container from gaining more privileges than its parent process (including via setuid/setgid binaries)?

Choose one answer
Check answer and explanation

Correct answer: allowPrivilegeEscalation: false

Explanation

Setting allowPrivilegeEscalation: false sets PR_SET_NO_NEW_PRIVS on the process so child processes cannot escalate privileges beyond the parent.

Common trap

Setting allowPrivilegeEscalation: false sets PR_SET_NO_NEW_PRIVS on the process so child processes cannot escalate privileges beyond the parent.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.IV · CKAD practice question

Which kubectl command deletes a Secret named old-cert in namespace ingress-tls?

Choose one answer
Check answer and explanation

Correct answer: kubectl delete secret old-cert -n ingress-tls

Explanation

kubectl delete secret -n deletes the specified Secret.

Common trap

kubectl delete secret -n deletes the specified Secret.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.IV · CKAD practice question

Which Linux capability must be added to a container's capabilities.add list so a non-root process can bind to privileged TCP ports below 1024 (such as port 80)?

Choose one answer
Check answer and explanation

Correct answer: NET_BIND_SERVICE

Explanation

CAP_NET_BIND_SERVICE (written NET_BIND_SERVICE in Kubernetes capabilities.add) permits binding sockets to ports below 1024.

Common trap

CAP_NET_BIND_SERVICE (written NET_BIND_SERVICE in Kubernetes capabilities.add) permits binding sockets to ports below 1024.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.IV · CKAD practice question

Which Pod securityContext field ensures files created inside shared volumes are owned by group ID 3000?

Choose one answer
Check answer and explanation

Correct answer: fsGroup: 3000

Explanation

spec.securityContext.fsGroup sets the supplemental group ID applied to volume files and directories so Pods can read/write shared volumes.

Common trap

spec.securityContext.fsGroup sets the supplemental group ID applied to volume files and directories so Pods can read/write shared volumes.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.IV · CKAD practice question

Why is storing secrets in a plain ConfigMap considered a security mistake in Kubernetes?

Choose one answer
Check answer and explanation

Correct answer: ConfigMaps are non-secret configuration objects and are treated as cleartext config rather than Secret objects with Secret access controls and encryption options

Explanation

ConfigMaps are meant for non-sensitive configuration and lack Secret semantics, RBAC separation, and secret-specific handling.

Common trap

ConfigMaps are meant for non-sensitive configuration and lack Secret semantics, RBAC separation, and secret-specific handling.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.IV · CKAD practice question

You create a Role named pod-reader in namespace dev that allows get, list, and watch on pods. Which command binds pod-reader to ServiceAccount reader-sa in namespace dev?

Choose one answer
Check answer and explanation

Correct answer: kubectl create rolebinding pod-reader-binding --role=pod-reader --serviceaccount=dev:reader-sa -n dev

Explanation

kubectl create rolebinding binds a Role (or ClusterRole) to a ServiceAccount (:) within a specific namespace.

Common trap

kubectl create rolebinding binds a Role (or ClusterRole) to a ServiceAccount (:) within a specific namespace.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


Back to all topics