Re:Writing a Kubernetes Operator
by ojhughes on Thursday March 09, 2023 @01:20PM
(#35084670)
Adding the patch api is neat! I’ve solved this in the past by embedding the entire PodSpec etc into the CRD
[ Parent
| on HN ]
Did you call your CRD "Deployment"?
It’s a common pattern [1]. Other than the GP patch example, how else can users override the child objects you’re controller creates?
1 https://github.com/prometheus-operator/prometheus-operator/b...
I'm not saying they shouldn't customize their PodSpec, I'm saying if they do, your controller is exactly the same as the built-in Deployment controller, running user-provided pods. Why build a copy of it?
Because it’s an aggregate of a number of different resources types and custom logic not exactly the same as deployment.
I can see you don’t like operators and that’s fine. Many folks find it’s a useful pattern to follow