EKCP aims to build a simple API to provide Kubernetes environment for development and 🚀 lab environments.
- Docker and docker-compose on the host
$> git clone https://github.com/SUSE/ekcp
$> cd ekcp
$> vim docker-compose.yml # Edit DOMAIN (pick one, reccomend to xip.io or nip.io) and KUBEHOST (your external IP)
$> docker-compose up -d
> kubectl create namespace ekcp
> kubectl apply -f https://raw.githubusercontent.com/SUSE/ekcp/master/kubernetes.yaml -n ekcp
> kubectl port-forward service/ekcp-api-master -n ekcp 8030Note: it works also on kind itself! Suitable for ephemeral environments inside a (testing) kube environment!
> kind create cluster
> kubectl cluster-info --context kind-kind
> kubectl create namespace ekcp
> kubectl apply -f https://raw.githubusercontent.com/SUSE/ekcp/master/kubernetes.yaml -n ekcp
> kubectl port-forward service/ekcp-api-master -n ekcp 8030 &curl -d "name=test" -X POST http://127.0.0.1:8030/new
curl -d "name=test&kindconfig=$(base64 kindconfig.yaml)" -X POST http://127.0.0.1:8030/new
curl -X DELETE http://127.0.0.1:8030/test
curl http://127.0.0.1:8030/kubeconfig/test
curl -d "name=test&kubeconfig=$(base64 kubeconfig)" -X POST http://127.0.0.1:8030/api/v1/cluster/insert
curl http://127.0.0.1:8030/ | jq -r .AvailableClusters
EKCP currently uses kind as backend to create new Kubernetes cluster. A proxy is setted up for each cluster to allow remote connection leveraging kubectl proxy. Gorouter is setted up with docker-compose and the routes are registered to a NATS server if ROUTE_REGISTER=true is set, allowing to use the gorouter as http proxy to resolve internal domains.
Openstack template is available here.
It can be used to spawn a group of VM that will be automatically attached to an api master node (which has to be provided already, in the same network)
To recreate the stack, just point the template URL to https://raw.githubusercontent.com/SUSE/ekcp/master/hack/openstack_heat/template.yaml.
Clusters that has been created with EKCP needs to be deleted from the API. If you turn down and start up again the EKCP API while a cluster is up, it would then fail see this Issue on GitHub for more context.
The workaround is or either delete the kind cluster manually, or use the api to turn them down.