Advanced Kubernetes Operator Development with Finalizer, Informer, and Webhook

Stefanie Lai
Geek Culture
Published in
6 min readJun 27, 2021

--

In the previous articles, I introduced Kubernetes Operator, wrote a basic Operator using Kubebuilder, and improved it afterward.

Operator itself has more to explore. In this article, I will focus on finalizer , informer, and webhook and the main approach of adding them to the previous Operator.

from Unsplash, @Roland Kay-Smith

Key Takeaways:

  • Understanding Kubernetes deletion mechanism and Finalizer
  • Comprehending Kubernetes webhook
  • Customizing webhook and deletion finalizer
  • Knowing Informer and responding to events in controller

Kubernetes Object Deletion

Every Kubernetes user has such experience that the deletion gets stuck for a very long time when deleting the resources manually via kubectl in CLI. To protect yourself from being furious, understanding the mechanism behind the scenes is helpful. Two major factors are Finalizers and Graceful Deletion.

The deletion process has three steps in general.

  • Submit a delete request from Client API. kubectl

--

--