On which level can you configure securityContext field in Kubernetes?

Experience Level: Senior
Tags: Kubernetes

Answer

Both the Pod and the Container have a securityContext field.

To specify security settings for a Container, include the securityContext field in the Container manifest.

To specify security settings for a Pod, include the securityContext field in the spec field of the Pod.

Security settings that you specify for a Container apply only to the individual Container, and they override settings made at the Pod level when there is overlap. Container settings do not affect the Pod's Volumes.

Comments

No Comments Yet.
Be the first to tell us what you think.
Kubernetes Certified Application Developer (CKAD) preparation
Kubernetes Certified Application Developer (CKAD) preparation

Are you learning Kubernetes ? Try our test we designed to help you progress faster.

Test yourself
Kubernetes
Kubernetes

Are you learning Kubernetes ? Try our test we designed to help you progress faster.

Test yourself