<p>I'm busy testing out kubernetes on my local pc using <a href="https://github.com/kubernetes/kubernetes/blob/master/docs/getting-started-guides/docker.md" rel="nofollow">https://github.com/kubernetes/kubernetes/blob/master/docs/getting-started-guides/docker.md</a> </p>

<p>which launches a dockerized single node <code>k8s</code> cluster. I need to run a privileged container inside k8s (it runs docker in order to build images from dockerfiles). What I've done so far is add a security context <code>privileged=true</code> to the pod config which returns forbidden when trying to create the pod. I know that you have to enable privileged on the node with <code>--allow-privileged=true</code> and I've done this by adding the parameter arg to step two (running the master and worker node) but it still returns forbidden when creating the pod. </p>

<p>Anyone know how to enable privileged in this dockerized k8s for testing?</p>

<p>Here is how I run the <code>k8s</code> master:</p>

<pre><code>docker run --privileged --net=host -d -v /var/run/docker.sock:/var/run/docker.sock  gcr.io/google_containers/hyperkube:v1.0.1 /hyperkube kubelet --api-servers=http://localhost:8080 --v=2 --address=0.0.0.0 --allow-privileged=true --enable-server --hostname-override=127.0.0.1 --config=/etc/kubernetes/manifests
</code></pre>

<p>Update: Privileged mode is now enabled by default (both in the apiserver and in the kubelet) starting with the 1.1 release of Kubernetes. </p>

<hr>

<p>To enable privileged containers, you need to pass the <code>--allow-privileged</code> flag to the Kubernetes apiserver <em>in addition</em> to the Kubelet when it starts up. The manifest file that you use to launch the Kubernetes apiserver in the single node docker example is bundled into the image (from <a href="https://github.com/kubernetes/kubernetes/blob/master/cluster/images/hyperkube/master.json" rel="nofollow">master.json</a>), but you can make a local copy of that file, add the <code>--allow-privileged=true</code> flag to the apiserver command line, and then change the <code>--config</code> flag you pass to the Kubelet in Step Two to a directory containing your modified file. </p>
