karmada: don't reconcile resourcebinding when change resourceselector of propagation policy

What happened: change the resourceselector of propagation policy, the resourcebinding of old match resource doesn’t be deleted

apiVersion: policy.karmada.io/v1alpha1
kind: PropagationPolicy
metadata:
  name: nginx-propagation
spec:
  resourceSelectors:
    - apiVersion: v1
      kind: Service
      labelSelector:
        matchLabels:
          app: nginx
  placement:
    clusterAffinity:
      clusterNames:
        - paas-federal-user1-master1
        - paas-federal-user2-master1

What you expected to happen: the resourcebinding of old match resource be deleted

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

propagaion policy is mentioned above. the resource as fellow:

apiVersion: v1
kind: Service
metadata:
  name: nginx-1
  labels:
    app: nginx-1
spec:
  ports:
  - port: 80
    name: web
  selector:
    app: nginx

Anything else we need to know?:

Environment:

  • Karmada version:
kubectl karmada version: version.Info{GitVersion:"v1.3.0", GitCommit:"12e8f01d01571932e6fe45cb7f0d1bffd2e40fd9", GitTreeState:"clean", BuildDate:"2022-08-31T13:09:24Z", GoVersion:"go1.18.3", Compiler:"gc", Platform:"linux/amd64"}

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 20 (17 by maintainers)

Most upvoted comments

Hi, @olderTaoist @weilaaa Thanks for your feedback and understanding of the problem.

Currently, in karmada, the life cycle of rb/crb is consistent with that of resource template. As discussed in the issue, after the resourcesselector of pp/cpp is modified, the original resource template is no longer matched, but the rb still exists. This is because the resource template still exists. When a new PP policy is used to name the resource template, the resource template is modified in the rb/crb. After a resource template is deleted, the resource template is also deleted. In fact, when a pp/cpp is deleted, if the original resource template still exists, the rb/crb also still exists. The two behaviors are essentially the same, that is, the life cycle of the rb/crb must be consistent with that of the resource template.

Hi @olderTaoist @weilaaa Can you help come up with a relatively complete solution? If it’s convenient, I think we can also use a proposal to handle it.

i add a proposal here @weilaaa @XiShanYongYe-Chang

Hi @olderTaoist @weilaaa Can you help come up with a relatively complete solution? If it’s convenient, I think we can also use a proposal to handle it.

ok, invite you to view when finished writing the proposal

For PP deletion or modification of ResourceSelector

Totally agree.

How users can decide how to handle whether RB needs cleaning.

I prefer to add a new gate in pp to determine this behavior, and the default is consistent with the current one to be compatible with the existing data. User can open new gate in pp to change this behavior if he knows what he is doing.