Skip to content

Kubeception implements the Cluster API using Kubernetes itself as a host for the Control Plane.

License

Notifications You must be signed in to change notification settings

adracus/kubeception

Repository files navigation

kubeception

Go Report Card Documentation GitHub Build Status

kubeception is an implementation of the Kubernetes Cluster API using Kubernetes itself as environment.

⚠ Caution ⚠: Kubeception is far from production ready and far from secure: It does not care at all about proper authentication / authorization. This is merely a PoC of what can be done with the cluster API + the kubeception approach.

Intro

The control plane of a cluster is self-hosted by providing the required components (etcd, Kube API server etc.) via Kubernetes primitives (Deployments, Services, StatefulSets).

Machines are created by running a privileged pod with kubelet and docker in a 'dind' setup (docker-in-docker). The image for this is built and provided via dind-kubelet.

As of now, there is neither a proper overlay network between the nodes nor a cluster-dns. This may come in the future but as of now this is just a minimal PoC that allows running a hello-world docker container.

Setup

You'll need a Kubernetes cluster for this. The recommended way of getting one is by using kind, as kubeception is developed mainly with kind and thus this is the most tested way.

Once you have a cluster, apply all cluster-api CRDs to the cluster. You can do this by running

kubectl apply -f config

In another window, run

make start

This will run the kubeception cluster and machine controller which reconciles the respective resources.

Control Planes

Once you've done that you're ready to create your first cluster by running

kubectl apply -f example/cluster.yaml

This spins up the required components in your current namespace. After a while, when all components are there, you can connect to the API server and experiment with it. For quick experiments, there is a hack script which sets up a container inside your cluster with the kubeconfig already at the right place and kubectl in your path. You can run it via

./hack/hyper.sh

Machines

To setup a machine, run

kubectl apply -f example/machine.yaml

This runs your 'machine' and connects it to the API server of the referenced cluster. Once the machine is up and running, you can now connect to your cluster and run the 'hello-world':

./hack/hyper.sh

# Verify that the node is there and ready
kubectl get nodes

# Run the hello-world
kubectl run --replicas=1 --restart=Never --image=hello-world -it hello

About

Kubeception implements the Cluster API using Kubernetes itself as a host for the Control Plane.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages