fleet icon indicating copy to clipboard operation
fleet copied to clipboard

resource installed when under one cluster group target is not removed when cluster moved to another cluster group target

Open aDisplayName opened this issue 2 years ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

In the same fleet workspace, if two cluster group is targeted by two different gitrepo, then when one cluster is moved between different cluster groups, the deployed bundle from the older cluster group / git repo, is not being removed even though it was not supposed to be deployed to the new cluster group, based on the gitrepo definitions.

Expected Behavior

Bundle targeted for different cluster group should be removed from the target cluster when the cluster is removed from the original cluster group.

Steps To Reproduce

The following are in worksapce fleet-default We have two ClusterGroup defined:

  • group-a: targetting cluster with label: my/tag In a
  • group-b: targetting cluster with label: `my/tag' In 'b'

cluster group setup

Clusters are grouped into one of these two groups by label.

We have two GitRepo defined in fleet-default namespaces:

  • repo-a: Deploy Target is set to group-a
  • repo-b: Deploy Target is set to group-b gitrepo setup

Both repos are using same remote source repository.

  • Url: https://github.com/aDisplayName/bugsamplecode.git
  • Branch: main
  • Path: /20220815

Steps:

  1. Once we enroll one cluster into group-a using appropriate label, the bundle repo-a-20220815 was deployed to the target cluster.
  2. Then we change the labelling of the cluster, effectively move it from group-a to group-b, the bundle repo-a-20220815 was not removed from the cluster, while the bundle repo-b-20220815 was attempted to be deployed to the target cluster. Since both bundles deploy same deployments and services to the same namespace, conflicts show up. image
  3. Only when perform "Force update" of GitRepo objects, the bundle repo-a-20220815 was removed from cluster and the new bundle repo-b-20220815 was installed.
  4. Alternatively, by moving the cluster out workspace fleet-default and move it into a different workspace, the bundles deployed are now being removed completely.

Expected behavior, When cluster is moved from cluster group group-a to group-b, the bundle targeted for group-a should to be removed, so that resource conflict would be avoid between git repos.

Environment

- Rancher: 2.6.3
- fleet: 
  - Helm Chart: fleet:100.0.2+up0.3.8
    rancher/fleet:v0.3.8
- Cluster: 
  - Provider: K3s
  - kubernetes version: 1.21.14, 1.20.6

Logs

No response

Anything else?

No response

aDisplayName avatar Aug 15 '22 19:08 aDisplayName