After understanding how an informer can be used to implement a custom controller, we will now learn more about the inner working of an informer. We have seen that essentially, informers use the Kubernetes API to learn about changes in the state of a Kubernetes cluster and use that information to maintain a cache (the…More
Understanding Kubernetes controllers part II – object stores and indexers
In the last post, we have seen that our sample controller uses Listers to retrieve the current state of Kubernetes resources. In this post, we will take a closer look at how these Listers work. Essentially, we have already seen how to use the Kubernetes Go client to retrieve informations on Kubernetes resources, so we…More
Understanding Kubernetes controllers part I – queues and the core controller loop
In previous posts in my series on Kubernetes, we have stumbled across the concept of a controller. Essentially, a controller is a daemon that monitors the to-be state of components of a Kubernetes cluster against the as-is state and takes action to reach the to-be state. A classical example is the Replica set controller which…More
Extending Kubernetes with custom resources and custom controllers
The Kubernetes API is structured around resources. Typical resources that we have seen so far are pods, nodes, containers, ingress rules and so forth. These resources are built into Kubernetes and can be addresses using the kubectl command line tool, the API or the Go client. However, Kubernetes is designed to be extendable – and…More
Learning Go with Kubernetes IV – life of a request
So far we have described how a client program utilizes the Kubernetes library to talk to a Kubernetes API server. In this post, we will actually look into the Kubernetes client code and try to understand how it works under the hood. When we work with the Kubernetes API and try to understand the client…More
Learning Go with Kubernetes III – slices and Kubernetes resources
In the last post, we have seen how structures, methods and interfaces in Go are used by the Kubernetes client API to model object oriented behavior. Today, we will continue our walk through to our first example program. Arrays and slices Recall that in the last point, we got to the point that we were…More
Learning Go with Kubernetes II – navigating structs, methods and interfaces
In the last post, we have set up our Go development environment and downloaded the Kubernetes Go client package. In this post, we will start to work on our first Go program which will retrieve and display a list of all nodes in a cluster. You can download the full program here from my GitHub…More
Learning Go with Kubernetes I – basics
When you work with Kubernetes and want to learn more about its internal workings and how to use the API, you will sooner or later reach the point at which the documentation can no longer answer all your questions and you need to consult the one and only source of truth – the source code…More
Kubernetes on your PC: playing with minikube
In my previous posts on Kubernetes, I have used public cloud providers like AWS or DigitalOcean to spin up test clusters. This is nice and quite flexible – you can create clusters with an arbitrary numbers of nodes, can attach volumes, create load balancers and define networks. However, cloud providers will of course charge for…More
Automating cluster creation on DigitalOcean
So far I have mostly used Amazons EKS platform for my posts on Kubernetes. However, this is of course not the only choice – there are many other providers that offer Kubernetes in a cloud environment. One of them which is explicitly targeting developers is DigitalOcean. In this post, I will show you how easy…More