use setControllerReference #3944
-
when i use kubebuilder, controllerutil.SetControllerReference() relation crd and statefulset; |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Kubebuilder provides a plugin that scaffolds the codebase to manage and deploy an image on the cluster. For more details, see the deploy image plugin documentation. By checking the testdata dir in the root directory of Kubebilder, you will find various examples. Then, examining the controller scaffolded within this plugin will provide code examples and links to the relevant documentation. See this example. To understand the ownerRef, check: https://kubernetes.io/docs/tasks/administer-cluster/use-cascading-deletion/ By usingcontrollerutil.SetControllerReference() it will set that the CRD ownerRef to the StatefulSet. So, I would suggest you check:
If the info above provide does not help you out, for we better help you out we would need to know:
In other words, we would need to have more further details. Enough for example to reproduce the scenario. |
Beta Was this translation helpful? Give feedback.
Kubebuilder provides a plugin that scaffolds the codebase to manage and deploy an image on the cluster. For more details, see the deploy image plugin documentation. By checking the testdata dir in the root directory of Kubebilder, you will find various examples. Then, examining the controller scaffolded within this plugin will provide code examples and links to the relevant documentation. See this example.
To understand the ownerRef, check: https://kubernetes.io/docs/tasks/administer-cluster/use-cascading-deletion/
By usingcontrollerutil.SetControllerReference() it will set that the CRD ownerRef to the StatefulSet. So, I would suggest you check: