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.
Related Kubernetes job interview questions
What is allowPrivilegeEscalation setting of securityContext used for in Kubernetes container manifest?
Kubernetes SeniorHow do you change a number of replicas of a Kubernetes deployment dep1 to 3?
Kubernetes SeniorHow do you convert a Kubernetes pod to a deployment?
Kubernetes SeniorHow do you rollback deployment d12 to a specific revision?
Kubernetes SeniorHow do you display a history of Kubernetes deployment d12 in namespace ns2?
Kubernetes Senior