Kubernetes IN Kubernetes yo
Status: alpha
Spawning (a lot of) Kubernetes clusters via Kubernetes API.
After putting a kinky object in a k8s cluster. A new fully working k8s API should be spawned.
It should be accessed as a an internal service and with an ingress.
Security is not an option.
Create a new cluster via Kinky
object like:
apiVersion: kinky.barpilot.github.com/v1alpha1
kind: Kinky
metadata:
namespace: my-team
name: my-kinky
Get a Token for kubelet to join.
On any worker server:
kubeadm join --token <token> my-kinky.my-team.example.com
etcd-operator is used to manage etcd clusters for spawned k8s.
For the moment, you have to use a patched version of etcd-operator. A docker version is available: guilhem/etcd-operator
A deployment can be used: /artifacts/deployment.yaml
k8sniff manage access to your spawned k8s.
To work you have to spawn this service and make it listen for external requests.
Requests will be forward to k8s server baser on "HOST" used by client.
First register the custom resource definition:
kubectl apply -f artifacts/kinkies-crd.yaml
An example of the Kinky
kind:
kubectl apply -f artifacts/my-kinky.yaml
Finally build and run the example:
go build
./kinky -kubeconfig ~/.kube/config