Kubernetes pod having containers of different privileges

6/22/2017

Can a pod have two containers of different privilege level? For example Container 'A' is a regular container and Container 'B' is a privileged container that can alter the network stack. Both containers will be packaged in a single pod. Now if the pod's privileged parameter is set true, would it mean that both of the containers are now privileged? or otherwise?

-- Zirak Zaheer
kubernetes

1 Answer

6/22/2017

The pod-level security context applies to all containers in the pod, but the per-container security context can override the settings for the individual container [1].

I'd suggest setting the pod-level default as secure (with minimal privilege) as possible, and only override the privilege setting for the containers that truly need it.

-- Yu-Ju Hong
Source: StackOverflow