sebgoa sebgoa on kubernetes, container, ktune, autotuning, deployment, application

Introducing `ktune` an auto-tuning system for k8s apps

Still in development mode is ktune a Kubernetes solutions to auto-deploy canaries when container images have a new version in a registry.

ktune is open-source and available on GitHub. It is still a work in progress but already offers a neat capability.

Kubernetes allows you to easily create deployments -declarative manifests of your microservices-. With ktune you can automatically detect the images used in your deployments and continuously watch the image versions in your image registry. If a new image is available ktune will launch a canary deployment.

The Pod created by the canary will be selected by the service exposing your deployments.

This is the first step in our efforts to provide auto-tuning controllers for your Kubernetes clusters. Controllers that will watch resources, usage and automatically update the resources based on specific rules.

Stay tuned (pun intended) for more about ktune, but to take it for a spin right now, try this:

Create a deployment that you consider stable and give it a label to identify it, for example in a single command:

$ kubectl run hostname --image=runseb/hostname:0.1.0 --labels="run=hostname,track=stable"

Start ktune, it will check the deployment and realize that there is an image on the Docker hub with the tag latest, it will generate a canary deployment.

$ ./ktune --debug
INFO[0000] Starting ktune  
INFO[0000] Worker iteration at 2016-10-17 15:19:58.655875145 +0200 CEST  
INFO[0010] Checking Deployment 'hostname'  
INFO[0011] Latest tag found to be ''  
INFO[0011] image '[runseb/hostname 0.1.0]' is outdated. New canary will update to 'runseb/hostname:latest'  
INFO[0011] Creating new deployment 'hostname-ktune'  

Check your deployments and resulting pods:

$ kubectl get deployments --show-labels
NAME             DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE       LABELS  
hostname         1         1         1            1           26m       run=hostname,track=stable  
hostname-ktune   1         1         1            1           5s        run=hostname,track=canary  
$ kubectl get pods
NAME                             READY     STATUS    RESTARTS   AGE  
hostname-3656820496-fztby        1/1       Running   0          31m  
hostname-ktune-969058483-k16wj   1/1       Running   0          4m