Write your own K8s operator

Using the Operator SDK to develop custom K8s operators

Simon Schneider

Playlists: 'froscon2023' videos starting here / audio

Would you like to store the database, kafka or third party saas configuration next to your application definition in K8s manifests, but there is no operator available for that? Write your own operator for K8s to cover your custom use case and simplify the configuration of these services for the developers.

Infrastructure as Code (IaC) is taking a leading role in many organizations when it comes to deploying applications. Besides setting up basic infrastructure like VMs, Storage, etc. there is also the task of setting up more high level infrastructure like databases, message queues, brokers etc. While both high and low level infrastructure can be managed in terraform, there is a language break between application configuration and infrastructure configuration. Application configuration is usually either managed by Ansible or when the application is deployed in K8s by K8s itself. In our case the database configuration was stored in terraform while the application was managed in K8s. This setup was not scalable enough and we needed a better solution. With the operator sdk we were able to develop our custom K8s operator and replace the existing infrastructure configuration in terraform with K8s resources.