You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Kubernetes and Operator-sdk, we can define CRD (Custom Resource Definition) and CR (Custom Resource). In my operator controller, when a CR is initialized, then I create a new Deployment and service.
When we delete a CR object, then the correlated resources (such as Deployment or service) will be deleted as well at the same time. I understand it should be done by CR/CRD finalizer, this is just my guess.
Now I hit an issue, during Operator testing, under envTest environment, when I delete a CR, its correlated resources (Deployment or service) have not been deleted.
I am confused. In real k8s cluster, the correlated resources (Deployment or service) can be deleted automatically when I delete a CR, under envTest environment, why it doesn't delete correlated resources?
Could anybody point out the reason.
The text was updated successfully, but these errors were encountered:
This is managed by a mix of object ownership and the gc controller. When an object is deleted, the gc controller cleans up everything owned by it. The reason you don't see this in tests is envtest doesn't run any kube-controller-manager controllers, including gc.
In Kubernetes and Operator-sdk, we can define CRD (Custom Resource Definition) and CR (Custom Resource). In my operator controller, when a CR is initialized, then I create a new Deployment and service.
When we delete a CR object, then the correlated resources (such as Deployment or service) will be deleted as well at the same time. I understand it should be done by CR/CRD finalizer, this is just my guess.
Now I hit an issue, during Operator testing, under envTest environment, when I delete a CR, its correlated resources (Deployment or service) have not been deleted.
I am confused. In real k8s cluster, the correlated resources (Deployment or service) can be deleted automatically when I delete a CR, under envTest environment, why it doesn't delete correlated resources?
Could anybody point out the reason.
The text was updated successfully, but these errors were encountered: