keikoproj / manager

Multi K8s cluster Namespace Management
Apache License 2.0
9 stars 3 forks source link

Namespace or No namespace for clusters in control plane cluster? #25

Closed mnkg561 closed 4 years ago

mnkg561 commented 4 years ago

Is this a BUG REPORT or FEATURE REQUEST?: QUESTION

What happened: Feedback from one of the meeting is whether we are complicating the architecture by creating namespaces for each cluster. The main reason why we created a namespace is to include all the resources related to particular cluster in that namespace and can be easily manage that cluster resources. For example, deleting that namespace as part of cluster unregistration deletes all the resources (managednamespace, k8s secrets etc).

Let's rethink about that decision and see if there are any other ways to solve this other than creating namespaces. Creating namespaces basically means we are taking over the control plane cluster instead of just creating custom resources.

One thing i have in my mind is using OwnerReference and other option could be using labels but there is a pretty good chance if any resource created outside manager have same label.

What you expected to happen: come up with better design.

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

Other debugging information (if applicable):

- controller logs:

$ kubectl logs

mnkg561 commented 4 years ago

https://kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/ _ OwnerReference withForeGround DeleteOption should do as per the documentation.

mnkg561 commented 4 years ago

With "No Namespace" implementation, we might have an issue with the namespace names where the use case is to have same namespace name but different clusters. Thats totally possible that namespace name can be same for whatever the reasons and we can allow that using this pattern

mnkg561 commented 4 years ago

Present implementation now uses "No Namespace" implementation and will be revisisted if needed in future.