Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: extend GitRepoStatus for easier differentiation of per-cluster state #3186

Closed
aruiz14 opened this issue Jan 8, 2025 · 2 comments

Comments

@aruiz14
Copy link
Contributor

aruiz14 commented Jan 8, 2025

Is your feature request related to a problem?

While working on #3102 and rancher/dashboard#12424, I realized that the dashboard has to do non-trivial computations in order to differentiate each cluster, which actually lead to a bug that made the resource list not to contain accurate information.

Solution you'd like

The UI was changed to use BundleDeployments for calculating the list of resources, but Fleet could ease this task by exposing the necessary information in a way that can directly be consumed (as far as I could see, Fleet is already doing the computation part that would allow this, it only needs to extend its API to expose it).

Alternatives you've considered

No response

Anything else?

No response

@aruiz14 aruiz14 self-assigned this Jan 8, 2025
@aruiz14 aruiz14 added this to the v2.11.0 milestone Jan 8, 2025
@rancherbot rancherbot added this to Fleet Jan 8, 2025
@github-project-automation github-project-automation bot moved this to 🆕 New in Fleet Jan 8, 2025
@aruiz14 aruiz14 moved this from 🆕 New to 📋 Backlog in Fleet Jan 8, 2025
@manno
Copy link
Member

manno commented Jan 8, 2025

Referring this comment which has some example json: rancher/dashboard#11643 (comment)

The gitrepo.status.resources struct is not handling perCluster well. E.g. it has duplications. UI currently uses bd list instead.

@sbulage
Copy link
Contributor

sbulage commented Feb 19, 2025

System Information

Rancher Version Fleet Version
v2.11-019a328d204d4d1a896b70b740beb275b88250df-head fleet:106.0.0+up0.12.0-alpha.14

Scenario

Sr No. Test case Result
1 Test GitRepo shows per-cluster state by installing Grafana application with 9 resources 3 clusters i.e. 27
2 Test GitRepo shows per-cluster state by installing Grafana application with 9 resources from 3 clusters to 2 clusters i.e. 18
3 Test GitRepo shows per-cluster state by installing Grafana application with 9 resources from 2 clusters to 3 clusters i.e. 27

Below are general steps

  • Create a GitRepo which installs Grafana application with 9 resources each cluster.
  • Wait for some time for GitRepo shows Active and resources to install.
  • Goto GitRepo and Click on YAML or Select GitRepo and click on three vertical dots and Edit YAML.
  • Find perClusterResourceCounts under status.perClusterResourceCounts (see below GitRepo YAML output.)

Result

1. Test GitRepo shows per-cluster state by installing Grafana application with 9 resources each cluster i.e. 27

GitRepo with Grafana resources 27 for 3 clusters

Image

perClusterResourceCounts YAML output for Grafana resource count for 3 clusters 27
  perClusterResourceCounts:
    fleet-default/imported-0:
      desiredReady: 9
      missing: 0
      modified: 0
      notReady: 0
      orphaned: 0
      ready: 9
      unknown: 0
      waitApplied: 0
    fleet-default/imported-1:
      desiredReady: 9
      missing: 0
      modified: 0
      notReady: 0
      orphaned: 0
      ready: 9
      unknown: 0
      waitApplied: 0
    fleet-default/imported-2:
      desiredReady: 9
      missing: 0
      modified: 0
      notReady: 0
      orphaned: 0
      ready: 9
      unknown: 0
      waitApplied: 0
  readyClusters: 3
  resourceCounts:
    desiredReady: 27
    missing: 0
    modified: 0
    notReady: 0
    orphaned: 0
    ready: 27
    unknown: 0
    waitApplied: 0

2. Test GitRepo shows per-cluster state by installing Grafana application with 9 resources from 3 clusters to 2 clusters i.e. 18

GitRepo with Grafana resources 18 for 2 clusters

Image

perClusterResourceCounts YAML output for Grafana resource count for 2 clusters 18
  perClusterResourceCounts:
    fleet-default/imported-1:
      desiredReady: 9
      missing: 0
      modified: 0
      notReady: 0
      orphaned: 0
      ready: 9
      unknown: 0
      waitApplied: 0
    fleet-default/imported-2:
      desiredReady: 9
      missing: 0
      modified: 0
      notReady: 0
      orphaned: 0
      ready: 9
      unknown: 0
      waitApplied: 0
  readyClusters: 2
  resourceCounts:
    desiredReady: 18
    missing: 0
    modified: 0
    notReady: 0
    orphaned: 0
    ready: 18
    unknown: 0
    waitApplied: 0

3. Test GitRepo shows per-cluster state by installing Grafana application with 9 resources from 2 clusters to 3 clusters i.e. 27

GitRepo with Grafana resources 27 for 3 clusters

Image

perClusterResourceCounts YAML output for Grafana resource count for 2 clusters 18
  perClusterResourceCounts:
    fleet-default/imported-0:
      desiredReady: 9
      missing: 0
      modified: 0
      notReady: 0
      orphaned: 0
      ready: 9
      unknown: 0
      waitApplied: 0
    fleet-default/imported-1:
      desiredReady: 9
      missing: 0
      modified: 0
      notReady: 0
      orphaned: 0
      ready: 9
      unknown: 0
      waitApplied: 0
    fleet-default/imported-2:
      desiredReady: 9
      missing: 0
      modified: 0
      notReady: 0
      orphaned: 0
      ready: 9
      unknown: 0
      waitApplied: 0
  readyClusters: 3
  resourceCounts:
    desiredReady: 27
    missing: 0
    modified: 0
    notReady: 0
    orphaned: 0
    ready: 27
    unknown: 0
    waitApplied: 0

P.S. Above steps are performed on same GitRepo.

@sbulage sbulage closed this as completed Feb 19, 2025
@github-project-automation github-project-automation bot moved this from Needs QA review to ✅ Done in Fleet Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

4 participants