20 Sep 2018 - jbo

In a previous blog post, I introduced the “new” docker support in Karaf and the use of Karaf static distribution.

In a previous blog post, I introduced the “new” docker support in Karaf and the use of Karaf static distribution.

This post follows the previous one by illustrating how to use Karaf docker image with a Kubernetes cluster. Preparing Karaf static docker image

As in the previous blog post, we are preparing a Karaf static distribution based docker image.

For this blog post, I’m using the example provided in Karaf: https://github.com/apache/karaf/tree/master/examples/karaf-docker-example/karaf-docker-example-static-dist.

I’m just building the distribution as usual: karaf-docker-example-static-dist$ mvn clean install

#Preparing kubernetes testing cluster

For this blog, I’m using a minikube installed locally.

The installation is pretty simple:

Now that minikube is installed on the machine, we can init the testing kubernetes cluster:

minikube start
 	minikube v1.2.0 on linux (amd64)
 	Creating virtualbox VM (CPUs=2, Memory=2048MB, Disk=20000MB) ...
 	Configuring environment for Kubernetes v1.15.0 on Docker 18.09.6
 	Pulling images ...
 	Launching Kubernetes ... 
 	Verifying: apiserver proxy etcd scheduler controller dns
 	Done! kubectl is now configured to use "minikube"

Now, we can install the command line tooling kubectl on our machine: $ apt install kubectl