Write your first simple Kubernetes Operator

Ask your human Operator to do all the complicated ugly work for you!

… or write your own Operator, if you are the expert and you know how the complicated ugly work, works in detail. This is how you can make sure it works in the future 😉

For those of you who don’t know Kubernetes Operators in combination with Ansible, let me just give you a very simplified description from my point of view:

Even a student with minimal knowledge of Kubernetes should be able to install a highly complex container-based application on top of Kubernetes or OpenShift. Eliminate the manual interaction effort as much as possible to deploy, run, and maintain your containerized application on Kubernetes or OpenShift with your Operator implementation.


During my search on the internet, how to build an own custom Kubernetes Operator, I came along to that awesome YouTube video with a talk from Keith Tenzer, he gave in 2020 on the Open Infrastructure Foundation Summit called “Building Kubernetes Operators with the Operator Framework and Ansible”.

In that talk he pointed to an example which exactly matched to what I was looking for:

A documentation to start from scratch building a simple Operator with an SDK which will be able to cover all levels of capabilities for an Operator maybe need to fulfil in the future.

As you see in the image below the Ansible SDK of Operator Framework does provide that capability, I searched for. Resource: Operator Framework

In this hands-on documentation you will automate the deployment of a Hello World! application to OpenShift, with an Hello World Operator implemented with Ansible.

The automation of your simple Operator will do for you the deployment of the simple application by …

  • … creating a deployment
  • … creating a service
  • … creating a route


An easy starting point to dig in the topics Kubernetes Operators and Ansible are these easy consumable YouTube Videos here:

I forked the GitHub project of Keith Tenzer and adjusted it. Now it’s contains more detailed information, but by using MkDos it’s very easy to follow. The Gif shows the navigation in the documentation and here is the link to the documentation with MkDocs.

Summary

From my point of view, this project is a perfect, easy starting point to jump into the “Custom Operators” and “Ansible” topics. It’s the right size to focus on practical and relevant topics to make something work.
For more details please visit the project.


Maybe this was useful for you and let’s see what’s next?

Greetings,

Thomas

#Operator, #OpenShift, #Ansible, #Kubernetes, #CustomOperator

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Blog at WordPress.com.

Up ↑

%d bloggers like this: