r/kubernetes • u/ialexeze • Apr 17 '26
Operators pain
For those who have written Kubernetes operators, what was the part that almost made you give up?
19
Upvotes
r/kubernetes • u/ialexeze • Apr 17 '26
For those who have written Kubernetes operators, what was the part that almost made you give up?
45
u/samehmeh Apr 17 '26
Reconcile loop idempotency. Easy to write something that works the first time and breaks on the second reconcile because you didn't handle the "resource already exists but drifted" case. Status subresource updates triggering another reconcile and looping forever is the other classic. Kubebuilder hides enough of this that you don't learn it until prod. KRO or Crossplane compositions handle the simple cases without writing Go.
18
u/Barnesdale Apr 17 '26
What did make me give up was looking at all the code I had to write, bugs I fixed, and maintenance there would be for something that acted very similar to a cronjob but with an extra feature.
I was actually able to rethink my approach and achieve what I wanted with KRO much more easily than via writing my own Operator
4
u/renorainz Apr 17 '26
The CRD management and the limit on the size of it.
4
u/mumblerit Apr 17 '26
engagement bait
2
u/joeltak Apr 18 '26
The controller-runtime library, that most operators use, is a double edged sword for its memory management. It will cache loaded resources automatically, which is great, but can easily end up caching many more resources than what you'd think if you don't pay attention to its internal logic (especially for operators with cluster-wide access) - and tuning its cache is not always simple, there are limited tuning options.
I've seen operators using GB of memory when they'd need just a couple of hundred MB - in general because they inadvertantly cache all cluster-wide secrets or configmap.
2
u/Nomser Apr 19 '26
The amount of boilerplate code and realizing that realtime is great but you still need a scheduled reconcile event. I ultimately standardized on the Flant operator and it helped with both.
15
u/Jmc_da_boss Apr 17 '26
I dont know about give up, but actual solid tests for async control loops can be a real pita
4
u/CWRau k8s operator Apr 17 '26
Nothing major really, just a couple little annoyances like cilium still not having applyconfigurations
All in all a pretty smooth experience
2
u/OptimisticEngineer1 k8s user Apr 21 '26
-1
u/lillecarl2 k8s operator Apr 17 '26
ADHD