I am using kubebuilder to create a Kubernetes operator. When an object of my kind is initiated I have to parse the spec and update the objects based on a few calculations.
From what I can tell I can either update the status of the object, the metadata, or a managed field (I may be wrong?). It appears that the sigs.k8s.io/controller-runtime/pkg/client
library is responsible for how to update these fields (I'm not completely sure). I am having trouble understanding the docs.
I have the following questions:
- Are there a guide to best practices about where to store configuration on the object between status, metadata (labels or annotations), and managed fields?
- How do I update/patch the annotations of an object similar to how I would use
r.Status().Update(ctx, &thing);
to update the status?