Skip to content
Français
Account: not signed in, sync available My learning
Select theme
Français

Kubernetes Security Context: control your Pods' permissions

By updated

Improve this page

Logo Kubernetes

The Security Context defines the privileges and the runtime restrictions of your Pods and their containers. It sets the user the process runs as, the Linux capabilities it keeps, whether it can write to the filesystem and whether it can gain privileges. It is the tool that applies the principle of least privilege to a Kubernetes workload. This lesson is for readers who already know how to write a Pod and a Deployment, on the course's kind cluster running version 1.37.

The Security Context defines a framework of privileges, it does not secure a Pod on its own. It assumes a suitable image, one that accepts an arbitrary UID and does not run a root process internally, volumes compatible with fsGroup, a restricted ServiceAccount (see ServiceAccounts for developers), NetworkPolicies for network isolation and Pod Security Standards applied to the namespace.

What you will learn

  • Place a securityContext at the Pod level or the container level, and predict which one wins
  • Impose the execution identity with runAsUser, runAsGroup, runAsNonRoot and supplementalGroups
  • Drop Linux capabilities and block privilege escalation
  • Protect the filesystem with readOnlyRootFilesystem and fsGroup
  • Set a seccomp profile, and recognize procMount, SELinux and user namespaces in a manifest
  • Check the result from inside the container and diagnose a Pod that no longer starts

What is a Security Context?

A Security Context is a set of parameters that define the privileges and the restrictions of a Pod or a container. The table sorts the parameters by what they control.

What it controlsExample parameters
Execution identityrunAsUser, runAsGroup, runAsNonRoot, supplementalGroups
Linux capabilitiescapabilities.add, capabilities.drop
Filesystem accessreadOnlyRootFilesystem, fsGroup
Privilege escalationallowPrivilegeEscalation, privileged
Security profilesseccompProfile, seLinuxOptions, procMount

These parameters are set in two places, and this distinction governs everything else: spec.securityContext applies to all the containers of the Pod, spec.containers[].securityContext to a single container, whose values it overrides.

Pod Security Context vs Container Security Context

The two levels do not carry the same fields. The table sorts the main fields: some exist only at the Pod level, others only at the container level, and a few are set in both places.

Where the field is setFields
Pod level onlyfsGroup, fsGroupChangePolicy, supplementalGroups, supplementalGroupsPolicy, sysctls, seLinuxChangePolicy
Container level onlyallowPrivilegeEscalation, capabilities, privileged, procMount, readOnlyRootFilesystem
Both levelsrunAsUser, runAsGroup, runAsNonRoot, seLinuxOptions, seccompProfile, appArmorProfile, windowsOptions

The following manifest shows the two blocks side by side, the most common layout in production. It uses busybox, which writes nothing and listens on no port: the image therefore starts with a read-only root, under a non-root UID and without any capability.

apiVersion: v1
kind: Pod
metadata:
name: security-demo
spec:
# Security Context at the POD level
securityContext:
runAsUser: 1000 # UID for all containers
runAsGroup: 3000 # GID for all containers
fsGroup: 2000 # GID for mounted volumes
supplementalGroups: # Secondary groups
- 4000
- 5000
containers:
- name: app
image: busybox:1.37@sha256:bdf57e528e45e4433820e045b29b4597825a1c9e38353532d90a01445013f82e
command: ["sh", "-c", "id && sleep 3600"]
# Security Context at the CONTAINER level
securityContext:
runAsNonRoot: true # Refuses to start if root
readOnlyRootFilesystem: true # Read-only root filesystem
allowPrivilegeEscalation: false # Blocks setuid/setgid
capabilities:
drop:
- ALL

Priority rule

When a parameter is present in both places, the one closest to the process wins. The Pod level therefore acts as a default value, which each container can override for itself.

Parameter defined at the...Behavior
Pod onlyApplies to all containers
Container onlyApplies to that container
Pod AND containerThe container value overrides the Pod value

In practice, you set the shared parameters at the Pod level (runAsUser, fsGroup, supplementalGroups) and the ones specific to each container at the container level (capabilities, readOnlyRootFilesystem). A sidecar rarely needs the same capabilities as the application it accompanies.

Control the execution identity

The execution identity answers one question: under which UID and GID does the process run once the container has started? With no setting, it is the user declared by the image's USER instruction, and if the image declares none, it is root. The parameters below impose this identity from the manifest, without rebuilding the image.

runAsUser and runAsGroup

These parameters define the UID and the GID under which the container's main process runs.

apiVersion: v1
kind: Pod
metadata:
name: user-demo
spec:
securityContext:
runAsUser: 1000 # UID 1000 (non-root)
runAsGroup: 3000 # GID 3000
containers:
- name: app
image: busybox:1.37@sha256:bdf57e528e45e4433820e045b29b4597825a1c9e38353532d90a01445013f82e
command: ["sh", "-c", "id && sleep 3600"]

The container log shows what the id command read at startup. The line must carry uid=1000 and gid=3000, the two values of the manifest.

Terminal window
kubectl apply -f user-demo.yaml
kubectl logs user-demo

runAsNonRoot

This parameter tells Kubernetes to refuse to start the container if it would run as root.

spec:
containers:
- name: app
image: nginx:1.30@sha256:9bf97bd7714f5e24c1ccd545ecb9eb5435cb6d109c97cebb15e7e455e0239edb
securityContext:
runAsNonRoot: true

The official nginx image starts as root: this Pod therefore stays in CreateContainerConfigError, and kubectl describe pod gives the reason, container has runAsNonRoot and image will run as root. The refusal happens before the process is launched, so nothing runs as root.

Why is an image with a named USER rejected?

runAsNonRoot: true does not simply test "UID different from 0". The kubelet only has the image configuration at hand, not its filesystem: it cannot open /etc/passwd to resolve a name. It needs a numeric UID, on one side or the other:

  1. the image declares a non-zero numeric UID in its USER, for example USER 1000, or
  2. the Pod explicitly sets a non-zero runAsUser.

A USER appuser in the Dockerfile is therefore not enough, even if that account really is non-root in the image. Three images that differ only by this line were measured on the course's kind cluster, on 1.37.

Image USERResultkubelet message
1000starts, id -u returns 1000none
appuserrejectedimage has non-numeric user (appuser), cannot verify user is non-root
absentrejectedimage will run as root

The two messages are different, and the distinction saves time. The last one says the image runs as root. The other one only says that the kubelet could not verify: this is not a flaw, it is a cautious refusal.

The fix fits in one line, verified on the same image with the named USER: adding runAsUser: 1000 to the Pod makes it start, with id -u at 1000. The other solution is to build the image with a numeric USER. A RUN adduser followed by a USER <name> is the classic trap: the intention is good, the verification fails anyway.

supplementalGroups

This parameter adds secondary groups to all the processes of the Pod's containers.

apiVersion: v1
kind: Pod
metadata:
name: groups-demo
spec:
securityContext:
runAsUser: 1000
runAsGroup: 1000
supplementalGroups:
- 4000 # Group to access some files
- 5000 # Group to access other resources
containers:
- name: app
image: busybox:1.37@sha256:bdf57e528e45e4433820e045b29b4597825a1c9e38353532d90a01445013f82e
command: ["sh", "-c", "id && sleep 3600"]

The log must list the primary group (1000) then the two secondary groups (4000 and 5000) in the groups field.

Terminal window
kubectl logs groups-demo

Three group parameters coexist and are easily confused. The table says what each one is for.

ParameterRole
runAsGroupPrimary group of the process
fsGroupGroup that owns the mounted volumes
supplementalGroupsSecondary groups of the process

Complete identity example

This manifest brings together the three previous parameters and adds the blocking of privilege escalation. It is the minimum baseline expected for a production workload.

apiVersion: v1
kind: Pod
metadata:
name: secure-user
spec:
securityContext:
runAsUser: 1000
runAsGroup: 1000
runAsNonRoot: true
supplementalGroups: [4000]
containers:
- name: app
image: busybox:1.37@sha256:bdf57e528e45e4433820e045b29b4597825a1c9e38353532d90a01445013f82e
command: ["sh", "-c", "id && sleep 3600"]
securityContext:
allowPrivilegeEscalation: false

The log confirms the effective identity: uid=1000, gid=1000 and the secondary group 4000 in groups. The container's /proc/1/status file carries the trace of the escalation block: the NoNewPrivs line must be 1.

Terminal window
kubectl logs secure-user
kubectl exec secure-user -- grep NoNewPrivs /proc/1/status

The example runs on busybox and not on nginx, and this is no accident. The official nginx image starts as root to create its cache, then switches its workers to the nginx user. Launched with runAsUser: 1000, it stops immediately on mkdir() "/var/cache/nginx/client_temp" failed (13: Permission denied). Imposing an identity therefore requires an image designed for a non-root UID.

Protect the filesystem and volumes

By default, a container has a writable root filesystem. It is wiped at each container restart, but very real in the meantime: an attacker can drop a binary there or modify a configuration. readOnlyRootFilesystem locks this root, while fsGroup sets access to the mounted volumes, which stay writable.

readOnlyRootFilesystem

This parameter makes the container's root filesystem read-only. For nginx, which runs as root here, you have to give an emptyDir to each directory it writes to: its cache, its temporary files and its PID file.

apiVersion: v1
kind: Pod
metadata:
name: readonly-demo
spec:
containers:
- name: app
image: nginx:1.30@sha256:9bf97bd7714f5e24c1ccd545ecb9eb5435cb6d109c97cebb15e7e455e0239edb
securityContext:
readOnlyRootFilesystem: true
volumeMounts:
- name: tmp
mountPath: /tmp
- name: cache
mountPath: /var/cache/nginx
- name: run
mountPath: /var/run
volumes:
- name: tmp
emptyDir: {}
- name: cache
emptyDir: {}
- name: run
emptyDir: {}

fsGroup

The fsGroup parameter defines the GID that owns the mounted volumes. Kubernetes applies it at mount time, and the setgid bit makes files created afterwards inherit this group.

apiVersion: v1
kind: Pod
metadata:
name: fsgroup-demo
spec:
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 2000 # Volume files belong to group 2000
containers:
- name: app
image: busybox:1.37@sha256:bdf57e528e45e4433820e045b29b4597825a1c9e38353532d90a01445013f82e
command: ["sh", "-c", "ls -la /data && sleep 3600"]
volumeMounts:
- name: data
mountPath: /data
volumes:
- name: data
emptyDir: {}

The log lists the content of /data. On the line of the . directory, the owning group must be 2000 and the permissions must contain an s in place of the group's x, the mark of the setgid bit.

Terminal window
kubectl logs fsgroup-demo

fsGroup does not apply the same way everywhere. On an emptyDir, it works as described above. On a hostPath, no GID change takes place: the files keep the owner they have on the node. On a CSI volume, everything depends on the driver, and on NFS, on the server configuration. So check the real behavior on your persistent volumes before counting on it: it is a classic cause of an application that starts but cannot write anything.

Control privileges

The previous parameters designated who runs the process. These ones define what it is allowed to do once launched. Three levers combine: blocking privilege escalation, dropping Linux capabilities, and the privileged mode, which cancels more or less everything else.

allowPrivilegeEscalation

This parameter controls whether a process can obtain more privileges than its parent, for example by launching a setuid binary.

spec:
containers:
- name: app
image: nginx:1.30@sha256:9bf97bd7714f5e24c1ccd545ecb9eb5435cb6d109c97cebb15e7e455e0239edb
securityContext:
allowPrivilegeEscalation: false

This setting has to be written explicitly: not writing it is not the same as setting it to false. And nothing replaces it, that is the trap. capabilities.drop: [ALL] does reduce the available capabilities, but a process can still take advantage of a setuid binary as long as allowPrivilegeEscalation is not false. The two settings deal with different problems, and you have to set both.

capabilities

Capabilities are granular permissions that replace the "root or not root" choice. Instead of giving all of root's rights, you grant only the necessary capabilities.

Common capabilities

Linux splits root's historical powers into about forty independent capabilities. Here are the ones you will meet regularly in a manifest. The last two lines are warning signs in a code review, because they make it possible to bypass file permissions or to change identity.

CapabilityBitWhat it allows
NET_BIND_SERVICE10Listen on a port below 1024, for a root process (see below)
NET_RAW13Create raw sockets (ping, tcpdump)
SYS_PTRACE19Trace processes (debugging)
CHOWN0Change the owner of files
SETUID / SETGID7 / 6Change identity (potential escalation)
DAC_OVERRIDE1Ignore file permissions

The "Bit" column is used to read the CapEff value below: each capability corresponds to one bit of this number.

Drop ALL, then add only what is needed

The good practice is to drop all the capabilities, then add only the ones the application really needs. For the official nginx image, the list is read from its startup: the master process changes the owner of its cache, then switches its workers to the nginx user. It therefore needs CHOWN, SETUID and SETGID.

apiVersion: v1
kind: Pod
metadata:
name: cap-demo
spec:
containers:
- name: app
image: nginx:1.30@sha256:9bf97bd7714f5e24c1ccd545ecb9eb5435cb6d109c97cebb15e7e455e0239edb
securityContext:
capabilities:
drop:
- ALL
add:
- CHOWN # chown of the /var/cache/nginx cache
- SETGID # switch the workers to the nginx group
- SETUID # switch the workers to the nginx user

With drop: [ALL] alone, the Pod does not start. Its log gives the missing capability: chown("/var/cache/nginx/client_temp", 101) failed (1: Operation not permitted), so CHOWN. This is the normal approach: start from drop: [ALL], read the error, add the single capability it asks for. With the three capabilities above, nginx listens on port 80 and answers HTTP 200, without NET_BIND_SERVICE.

The following command reads the effective capabilities of the main process, in hexadecimal form.

Terminal window
kubectl exec cap-demo -- grep CapEff /proc/1/status
Output
CapEff: 00000000000000c1

Each bit of this value is a capability. c1 is written 11000001 in binary: bits 0, 6 and 7 are set to 1, that is CHOWN, SETGID and SETUID, according to the "Bit" column of the table above. Bit 10, NET_BIND_SERVICE, is 0. On a Linux workstation that has libcap, the capsh --decode=00000000000000c1 command does this calculation for you, but it is absent on macOS and nothing requires you to use it.

A container also receives capabilities without asking for anything: the runtimes (Docker, containerd, CRI-O) grant a default set, whose composition varies from one runtime and configuration to another. That is why the drop: [ALL] strategy followed by an explicit add is the only one that gives a predictable result: it assumes nothing about the environment.

Why is NET_BIND_SERVICE not enough to open port 80?

An added capability only becomes usable by a root process, or by a binary that carries this capability as a file attribute. A process running under UID 1000 receives NET_BIND_SERVICE in its bounding set (CapBnd), but not in its effective set (CapEff). Measured on the course's kind cluster (Kubernetes 1.37.0, containerd 2.3.4), with and without capabilities.add: [NET_BIND_SERVICE]: CapEff is 0000000000000000 in both cases, and CapBnd is 0000000000000400 with the add.

On this cluster, port 80 nevertheless opens for a non-root process, without any capability. The reason lies in the runtime: containerd 2.3.4 sets net.ipv4.ip_unprivileged_port_start=0 in the Pod, so no port is reserved. The behavior depends on the runtime: a runtime that does not set this value would refuse port 80 to a non-root process, and NET_BIND_SERVICE would change nothing there. The following command reads the value in your Pod.

Terminal window
kubectl exec cap-demo -- cat /proc/sys/net/ipv4/ip_unprivileged_port_start

The output is 0 on the course's cluster. The recommendation that holds everywhere is to listen on a port above 1024, for example the nginx-unprivileged image on port 8080, as in the first lab of this lesson.

privileged (avoid at all costs)

The privileged: true mode disables a large part of the container's usual isolation.

# ❌ NEVER DO THIS IN PRODUCTION
spec:
containers:
- name: dangerous
image: busybox:1.37@sha256:bdf57e528e45e4433820e045b29b4597825a1c9e38353532d90a01445013f82e
securityContext:
privileged: true # Disables container isolation

Complementary security profiles

The settings seen so far deal with identity and permissions. These ones enable Linux kernel mechanisms relayed by the runtime. You write them by hand less often, but the Restricted level of the Pod Security Standards requires some of them. Only seccomp is configured in this lesson, and a dedicated guide takes it further. The other three are only named, so that you can recognize them in a manifest.

seccompProfile

The seccomp profile limits the system calls (syscalls) a container can make. It is set at the Pod or container level.

spec:
securityContext:
seccompProfile:
type: RuntimeDefault # Uses the runtime's default profile

Without seccompProfile, the container runs as Unconfined, so without any filter, unless the kubelet is launched with the seccompDefault option, which is disabled by default. A privileged container is always Unconfined. Setting RuntimeDefault yourself is therefore the only way not to depend on the node settings.

TypeDescription
RuntimeDefaultRuntime default profile (recommended)
UnconfinedNo restriction (not recommended)
LocalhostCustom profile present on the node

The seccomp guide (in French) details custom profiles.

procMount

The procMount parameter controls how /proc is mounted in the container. It is set at the container level only. By default, /proc is partially masked for security reasons, and the Pod Security Standards constrain this setting at the Baseline and Restricted levels: you do not relax it lightly.

SELinux and user namespaces: know their names

SELinux is a labeling mechanism of the kernel, present on RHEL and OpenShift. The seLinuxOptions field imposes a container's label, and seLinuxChangePolicy sets, at the Pod level, the way the label is applied to volumes.

User namespaces give the Pod its own identifier space: the container's root then corresponds to an unprivileged UID on the node. The field is written spec.hostUsers, outside the securityContext. Its default value is true: no Pod is isolated until it asks for hostUsers: false.

Starting template for production

Here is a Security Context to take as a starting point for a production workload. It combines the non-root identity, the read-only root, the absence of capabilities and the runtime's seccomp profile.

apiVersion: v1
kind: Pod
metadata:
name: production-secure
spec:
securityContext:
runAsUser: 1000
runAsGroup: 1000
runAsNonRoot: true
fsGroup: 1000
seccompProfile:
type: RuntimeDefault
containers:
- name: app
image: myapp:1.0.0
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
resources:
requests:
memory: "64Mi"
cpu: "100m"
limits:
memory: "128Mi"
cpu: "500m"
volumeMounts:
- name: tmp
mountPath: /tmp
volumes:
- name: tmp
emptyDir: {}

Security checklist

These seven settings are the ones a compliance audit checks first. The last column reminds you of what each one prevents: it is what lets you arbitrate when an application refuses to start and you are tempted to relax a parameter.

ParameterRecommended valueWhy
runAsNonRoottrueRefuses to start if root, or if the kubelet cannot verify it
runAsUsera non-zero UIDThe Restricted level requires a non-zero UID; 1000 is a common convention, not a rule
allowPrivilegeEscalationfalseBlocks setuid/setgid (must be set explicitly)
readOnlyRootFilesystemtruePrevents uncontrolled writes
capabilities.dropALLRemoves all capabilities
privilegedfalse (or absent)Never true in production
seccompProfileRuntimeDefaultLimits the allowed syscalls

Relationship with Pod Security Standards

The Pod Security Standards (PSS) define three restriction levels. The Security Context is what you write in the Pod, the PSS are the rule the namespace imposes.

LevelWhat is allowed
PrivilegedEverything, no restriction
BaselineMinimal restrictions: no privileged, no hostNetwork, limited procMount
RestrictedFull hardening, a wider set of constraints

Beware of a common shortcut: Restricted does not boil down to "runAsNonRoot + drop: ALL + readOnlyRootFilesystem". The level imposes a far wider set of constraints, of which a strict securityContext is only one part. The full list lives in the official documentation and it changes from one version to the next.

Pod Security Admission applies these standards at the namespace level. A label is enough, and any non-compliant Pod is rejected at admission.

Terminal window
kubectl label namespace my-ns pod-security.kubernetes.io/enforce=restricted

The lesson on Pod Security Standards details how to set them up.

Test the configuration

A securityContext accepted by the API is not necessarily applied the way you imagine: the image, the runtime or the volume type can change its real effect. The following commands run from inside the container and show the effective state: the identity of the process, the capabilities kept and the ability to write.

A complete test Pod

This Pod gathers the settings to check: imposed UID and GID, read-only root, no capability. The three checks that follow apply to it.

apiVersion: v1
kind: Pod
metadata:
name: secure-test
spec:
securityContext:
runAsUser: 1000
runAsGroup: 1000
runAsNonRoot: true
containers:
- name: app
image: busybox:1.37@sha256:bdf57e528e45e4433820e045b29b4597825a1c9e38353532d90a01445013f82e
command: ["sh", "-c", "sleep 3600"]
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL

You can also get a Pod skeleton without creating anything in the cluster, then add the securityContext to it: under spec for the Pod level, under the container for the container level.

Terminal window
kubectl run secure-skeleton \
--image=busybox:1.37@sha256:bdf57e528e45e4433820e045b29b4597825a1c9e38353532d90a01445013f82e \
--dry-run=client -o yaml > secure-pod.yaml

Check the effective user

The id command displays the effective identity of the process. The values must match runAsUser and runAsGroup of the manifest exactly.

Terminal window
kubectl apply -f secure-test.yaml
kubectl exec secure-test -- id

The output must carry uid=1000 and gid=1000.

Check the capabilities

Capabilities appear in hexadecimal in /proc/1/status. The CapEff line is the one that counts: it represents the set the process can really use at that moment. With drop: [ALL] and no capability added, it contains only zeros.

Terminal window
kubectl exec secure-test -- grep CapEff /proc/1/status

Check readOnlyRootFilesystem

A touch at the root is the quickest test: it must fail, with a message ending in Read-only file system. If it succeeds, the parameter was not taken into account.

Terminal window
kubectl exec secure-test -- touch /test.txt

Troubleshooting

Almost all the incidents related to securityContext show up at one of two moments: either when the Pod starts, when Kubernetes refuses the configuration, or at the first write, when the application discovers its restrictions. The table matches each symptom with its cause, and the commands that follow confirm the diagnosis.

Common problems

When startup is refused, no log exists yet: these messages show up in the Events section of kubectl describe pod, not in kubectl logs. Dropping all the capabilities does not prevent listening on port 80 on the course's cluster. The refusal of port 80 only appears on a runtime that does not lower the threshold of low ports.

SymptomLikely causeSolution
container has runAsNonRoot and image will run as rootThe image really does run as rootAdd runAsUser: 1000, or fix the image
container has runAsNonRoot and image has non-numeric user (…)The image declares a USER by name: the kubelet cannot resolve it to a UIDAdd runAsUser: 1000, or rebuild the image with a numeric USER
Pod does not start, permission deniedrunAsUser incompatible with the imageCheck the UID the image expects
Application cannot writereadOnlyRootFilesystem: trueMount emptyDir volumes on the write directories
nginx with drop: [ALL] crashes on chown(...) failed (1: Operation not permitted)CHOWN is missingAdd CHOWN, SETUID and SETGID
Bind on port 80 refusedThe runtime does not lower ip_unprivileged_port_start, and the process does not have NET_BIND_SERVICE in its effective set (without a file or ambient capability, a non-root process does not have it)Listen on a port above 1024
Volume files not accessiblefsGroup not supported by the volumeCheck the compatibility of the storage backend

Debugging with kubectl

When the table is not enough, three commands give the full state: the Pod events, the securityContext actually recorded by the API after merging the Pod and container levels, then a throwaway container that serves as an unrestricted point of comparison.

Terminal window
# See the events
kubectl describe pod <pod-name>
# Check the security settings applied
kubectl get pod <pod-name> -o yaml | grep -A 20 securityContext
# Test interactively
kubectl run debug --rm -it \
--image=busybox:1.37@sha256:bdf57e528e45e4433820e045b29b4597825a1c9e38353532d90a01445013f82e \
-- sh

Put it into practice

Two exercises follow the order in which the subject is met. The first starts from a blank page: run a web server as a non-root user, without escalation, with a read-only root and all the capabilities dropped, while leaving it what it needs to write where it has to. A hardening that stops the application from starting is not hardening.

The second goes as far as immutability, that of the filesystem section: non-writable root, capabilities dropped, escalation forbidden. The whole difficulty lies in the few paths nginx still needs in order to serve, and that the exercise consists in finding.

Key takeaways

  1. runAsNonRoot: true refuses to start when Kubernetes cannot verify that the user is non-root, and a named USER is not enough.
  2. runAsUser imposes the UID when the image does not give a numeric one.
  3. allowPrivilegeEscalation: false is set explicitly, on top of drop: [ALL].
  4. capabilities.drop: [ALL], then add only the capability the error asks for. NET_BIND_SERVICE does not help a non-root process: listen on a port above 1024.
  5. readOnlyRootFilesystem: true is completed with emptyDir volumes for the write directories.
  6. The container values override the Pod values, and several fields exist at one level only.
  7. seccompProfile: RuntimeDefault has to be set yourself: without a profile, a container is Unconfined.
  8. fsGroup depends on the volume type: test it on your persistent volumes.

Test your knowledge

Seven questions drawn from this guide, with a pass mark set at 80%.

Knowledge check

Check what you have learned with this interactive quiz

7 questions
5 min
80% to pass

How it works

  • The timer starts when you click Start
  • Multiple choice, true/false and short answer questions
  • You can move between questions
  • Detailed results are shown at the end

Starts the quiz and the timer