Reputation: 1174
I have a few CRDs and each of them supposed to make edit Container.Spec
's across the cluster.
Like ENVs, Labels, etc...
Is it okay, if the resource is managed by more that one controller?
What are the possible pitfalls of this approach?
Upvotes: 6
Views: 1732
Reputation: 54267
Yes, the same object can be updated by multiple controllers. The Pod object is updated by almost a dozen at this point I think. The main problem you can run into is write conflicts. Generally in an operator you do a get, then some stuff happens, then you do an update (usually to the status subresource for a root object case). This can lead to race conditions. I would recommend looking at using Server Side Apply to reduce these issues, it handle per-field tracking rather than whole objects via serial numbers.
Upvotes: 5