How to Write a Kubernetes Operator in Java

How to Write a Kubernetes Operator in Java

Sep 13, 2019

Kubernetes is much more than a runtime platform for Docker containers. Its API can be extended with application-specific custom resource definitions (CRDs), and you can implement your own controllers adapting your applications dynamically to changes in the cluster.

Application-specific custom controllers are called "operators". Until recently, most operators were written in Go, re-using code from the built-in Kubernetes controllers. With Quarkus and the fabric8 Kubernetes Client we now have a great basis for implementing operators in Java, allowing us to integrate our existing code base with the power of Kubernetes API extensions.

At Instana, we used these new technologies to implement our instana-agent-operator. In this presentation, we will provide an experience report and lessons learned from implementing our own operator in Java. The operator is available on https://github.com/instana/instana-agent-operator.