<p>Has anyone tried out nested kubernetes cluster inside kubernetes, I want to emulated sandboxed a small kubernetes cluster inside my running kubernetes cluster and not again use VM's again and again for new cluster. </p>

<p>New clusters I want to used for testing and trail of various features of kubernetes, has anyone tried anything on it.</p>

<p>I tried various solution like.</p>

<ul>
<li><a href="https://github.com/marun/nkube" rel="nofollow noreferrer">https://github.com/marun/nkube</a></li>
<li><a href="https://kubernetes.io/blog/2017/01/how-we-run-kubernetes-in-kubernetes-kubeception/" rel="nofollow noreferrer">https://kubernetes.io/blog/2017/01/how-we-run-kubernetes-in-kubernetes-kubeception/</a></li>
</ul>

<p>I also tried <a href="https://github.com/kubernetes-sigs/kubeadm-dind-cluster" rel="nofollow noreferrer">https://github.com/kubernetes-sigs/kubeadm-dind-cluster</a> and this works for me, but it starts the k8s cluster using docker containers, but I wanted this sort of solution to work inside kubernetes, so that it can be scaled across nodes I have.</p>

<p>If anyone has tried it or can point to solution people have tried, it can be of great help.</p>

<p><strong>Edit 1:</strong></p>

<p>I know k8s runs workloads as containers and this was part of my problem, "is it possible to run k8s using containers or pods or using any other k8s constructs".</p>

<p>I know, we can create namespace and network policies around it, but that would regulate the system, I wanted people to play with master/api-servers freely, un-regulated like we do in minikube. Wanted to have freedom to screw up master/api-servers, and to clean mess probably just need something like <code>k8s delete cluster c1</code> or anything of that sort. </p>

<p>And for creating those clusters in <em>sandbox cluster</em> was just a command operation. Just  didn't wanted to spin vm's again and setup cluster, if someone wants to play with it,</p>

Sumit Murari
<p>I realize this question is way old and the landscape has changed dramatically, but just in case anyone else ends up here in 2022, make sure you look into Kubernetes-in-Docker (KinD) for this kind of situation: <a href="https://kind.sigs.k8s.io/" rel="nofollow noreferrer">https://kind.sigs.k8s.io/</a></p>
<p>This allows you to create local K8s clusters which run as local docker containers (e.g. local CP is a container, workers are containers, etc) and is excellent for this kind of experimental development work.</p>
