Public | Automated Build

Last pushed: a year ago
Short Description
Image for running a nested Kubernetes cluster.
Full Description

nkube (Nested Kubernetes)

nkube is a tool for deploying multinode
Kubernetes clusters on Kubernetes itself. It
uses helm to deploy a
consisting of containers running
systemd and
is then invoked to bootstrap a new Kubernetes cluster.


While nkube can potentially target any kubernetes deployment, it is
currently only tested with minikube. To get started:

minikube start
  • Initialize helm:
helm init
  • Ensure that the ip6_tables module is loaded on the docker host (required for calico):
minikube ssh
sudo modprobe ip6_tables
  • From the root of a clone of this repo, start a new nested cluster
    with the calico plugin. Deployment is likely to take 3-5m,
    depending on the speed of the host and its network connection:
./ [helm install args]
  • Once has finished, the cluster's rc file can be sourced to
    configure the bash environment:
. [cluster-id].rc
  • The rc file creates the nk alias to allow easy access to both
    the hosting and nested clusters:
kubectl get nodes     # Hosting cluster
nk kubectl get nodes  # Nested cluster
  • More than one nested cluster can be deployed at once. Switching
    between nested clusters is accomplished by sourcing the rc file of
    the desired cluster.

  • Since the cluster is deployed with helm, helm commands can be used
    to manage the cluster (e.g helm delete [cluster id] removes the

  • ssh access to the nodes of the cluster is not supported. Instead,
    use kubectl exec to gain shell access to the master and node

  • The number of nodes can be scaled by setting the replica count of
    the node deployment. The number of nodes is limited only by the
    capacity of the hosting cluster.


  • The use of persistent storage for etcd is currently unsupported. If
    the nested master fails, the cluster state is lost.
  • Due to the way docker-in-docker handles volumes, manual cleanup on
    the host docker is required:
docker volume ls -qf dangling=true | xargs -r docker volume rm
Docker Pull Command
Source Repository