Advanced Kubernetes Operators Development
How to build a production-standard Operator based on Kubebuilder. Tips and pitfalls
In the previous article ㉿ (Kubernetes Operator for Beginners — What, Why, How), I have described Kubernetes Operators’ concepts and how to implement one with a simple example of auto-generating ServiceAccount
and ClusterRoleBinding
through Kubebuilder.
But that example is rough and does not meet the production standards, just for illustration. 😞
- CRD Condition is not set. The
Condition status
is generally a monitoring field used by variouskubectl
tools to observe the resources’ status. - Without a health check, we can not add a liveness probe and readiness probe.
Operators that run in production obviously need more.
This article lists multiple aspects of building a stable and functional Operator by improving the previous one. And we will discuss some pitfalls encountered during the development.
Before starting, let’s review what Operator Controller is and what functions we want to achieve with it in Kubebuilder.
- Controller implements and manages the reconciliation loop
- Controller reads the desired state from the resources’ YAML and…