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

refactor: simplify context states update #9443

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

feloy
Copy link
Contributor

@feloy feloy commented Oct 17, 2024

Signed-off-by: Philippe Martin [email protected]

What does this PR do?

Working on #6114, informers need to be restarted in more circumstances, to be able to change their backoff configuration.

After a few iterations working on these informers, the logic to detect which informers need to be started/stopped is more and more complex, and there are still missing conditions.

With this PR, I propose to simplify the logic, with:

  • when the kubeconfig file changes:

    • all the informers (primary and secondary) for all contexts are stopped
    • primary informers for the current context are started
    • if there are less than 11 contexts, primary contexts for non-current contexts are started
  • when the current context becomes reachable:

    • if the frontend subscribed to the secondary informers, the secondary informers for this current context are started (1)
  • when the current context becomes unreachable:

    • the secondary informers for this current context are stopped
  • when the frontend subscribes to the secondary informers:

    • if the current context is reachable, the secondary informers for the current context are started (2)

Note that (1) and (2) have the same result, it depends on which one happens first.

  • Primary contexts are used to display the number of pods / deployments in each context in the Settings > Kubernetes page
  • Secondary informers are used to display the resources information in the Kubernetes pages (Nodes, Services, ...)

I would appreciate some feedback before to test it any further.

What issues does this PR fix or reference?

Part of #6114

How to test this PR?

Needs the PR #9411 to be fully functional

Unit tests need to be adapted to the new logic.

  • Tests are covering the bug fix or the new feature

@feloy feloy marked this pull request as ready for review October 17, 2024 13:22
@feloy feloy requested review from benoitf and a team as code owners October 17, 2024 13:22
@feloy feloy requested review from dgolovin, cdrage, axel7083, deboer-tim and jeffmaury and removed request for a team October 17, 2024 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant