cloud-ark / kubeplus

Kubernetes Operator for multi-instance multi-tenancy
https://cloudark.io/
Apache License 2.0
662 stars 82 forks source link

Handling CRDs defined in Sub-charts #1167

Closed devdattakulkarni closed 1 year ago

devdattakulkarni commented 1 year ago

As part of registering a Helm chart under a new CRD defined in ResourceComposition, KubePlus verifies the defined Helm chart and installs any CRDs that the helm chart is defining itself by checking for crds folder inside the helm chart package. It is possible that a Helm chart depends on other charts (defined under 'charts' folder) and these sub-charts have their own crds folder. We should check for such CRDs and install them as well.

Relevant part of the code:

cc: @eminalparslan

devdattakulkarni commented 1 year ago

The chart/sub-chart CRDs are not deleted when resourcecomposition is deleted. Belo we see crds from konghq api group. These are part of the kong chart, which is a child of the supabase chart.

(venv) vagrant@vagrant:/vagrant/share$ kubectl delete resourcecompositions supabase-res-composition --kubeconfig=kubeplus-saas-provider.json resourcecomposition.workflows.kubeplus "supabase-res-composition" deleted (venv) vagrant@vagrant:/vagrant/share$ kubectl get resourcecompositions No resources found in default namespace. (venv) vagrant@vagrant:/vagrant/share$ kubectl get crds NAME
ingressclassparameterses.configuration.konghq.com kongclusterplugins.configuration.konghq.com kongconsumers.configuration.konghq.com kongingresses.configuration.konghq.com kongplugins.configuration.konghq.com resourcecompositions.workflows.kubeplus resourceevents.workflows.kubeplus resourcemonitors.workflows.kubeplus resourcepolicies.workflows.kubeplus tcpingresses.configuration.konghq.com udpingresses.configuration.konghq.com