Cannot create priviledged containers

8/21/2015

I am using instructions from https://github.com/kubernetes/kubernetes/blob/master/docs/getting-started-guides/docker-multinode.md to setup a multinode kubernetes cluster on vmware vcloud infrastructure.

I was able to get the cluster working but when I tried the nfs example I was not able to create the nfs container. So I recreated all the VMs and rebuilt kubernetes from source using:

git clone https://github.com/kubernetes/kubernetes.git
cd kubernetes
sed -i 's/allow_privileged: .*/allow_privileged: true/g' cluster/saltbase/pillar/privilege.sls
./build/run.sh hack/build-cross.sh
cp _output/dockerized/bin/linux/$(dpkg --print-architecture)/kubectl /usr/local/bin
chmod +x /usr/local/bin/kubectl

and continued to setup the kubernetes cluster and retried the NFS example and I get the following error:

kubectl create -f nfs-server-pod.yaml 
The Pod "nfs-server" is invalid.
spec.containers[0].securityContext.privileged: forbidden '<*>(0xc20931650c)true'

I tried with both the master and 1.0.3 release and had the same result.

Can you please tell me how to resolve this issue and Thanks for your support

-- Sameer Naik
kubernetes

1 Answer

9/18/2015

We thought that turning privileged containers off by default would be good for security. It turns out to just be a pain point for a lot of people, so we're working to turn it on by default in kubernetes v1.1.

The --allow-privileged flag has to be set on both the kubelet and the apiserver - please check that

-- Tim Hockin
Source: StackOverflow