Maintain resource state #637
Replies: 1 comment 4 replies
-
Yes, there is :-) You can create an The version that I'm preparing right now has a KubernetesClientFactory that helps with creating all the clients. If you plan to update the same resource: https://buehler.github.io/dotnet-operator-sdk/src/KubeOps.Operator/README.html#controller If you don't: use the IKUbernetesClient (or IKubernetes if you want to do it yourself) and create any resource you want. But then I'd suggest you use the "owner reference" meta field to attach it to some other resouce. With the owner reference in place, the newly created object will be garbage collected when the owner is deleted. |
Beta Was this translation helpful? Give feedback.
-
Hi,
is there a recommended way how to create, delete or patch a resource via the operator or is this out of scope of this framework?
As far as I can see the operator SDK seems to be support reacting to a change in a desired resource state in the cluster via reconciliation, but does not seem to explicitly support syncing a resource status (e.g. via patch) or the existance of a resource (create, delete) to the resource state in the api server.
Maybe I am missing something, but according to K8s documentation this functionality is one of the core ideas of a Kubernetes controller, right?
Beta Was this translation helpful? Give feedback.
All reactions