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

daemon: Use LastSuccessInteraction instead of LastInteraction #31019

Merged
merged 1 commit into from Mar 22, 2024

Conversation

tkna
Copy link
Contributor

@tkna tkna commented Feb 28, 2024

cilium-agent periodically checks the connectivity to the k8s api-server by "kubernetes" probe. cachedVersion() returns a cached value of the k8s version to the probe if not expired or invalid.

The logic for evaluating the validity of the cache is as follows:

  1. check if the api-server connectivity is healthy. If the last check was more than k8sMinimumEventHeartbeat(default: 1m) ago, then valid=false is returned.
  2. if the api-server connectivity is given, returns valid=false if the last check was more than k8sVersionCheckInterval(default: 15m) ago.
  3. otherwise returns the cached value and valid=true.

Currently k8smetrics.LastInteraction.Time() is used in the step 1, which is updated periodically regardless of whether the api-server connectivity is alive or not. This commit fixes it to use k8smetrics.LastSuccessInteraction.Time() instead.

Fix the logic of the api-server connectivity check for the kubernetes probe

@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Feb 28, 2024
@github-actions github-actions bot added the kind/community-contribution This was a contribution made by a community member. label Feb 28, 2024
@tkna tkna marked this pull request as ready for review February 28, 2024 04:20
@tkna tkna requested a review from a team as a code owner February 28, 2024 04:20
@tkna tkna requested a review from ldelossa February 28, 2024 04:20
@ldelossa ldelossa added the release-note/bug This PR fixes an issue in a previous release of Cilium. label Mar 1, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Mar 1, 2024
@joestringer joestringer requested review from a team and squeed and removed request for a team March 4, 2024 21:39
@joestringer
Copy link
Member

/test

@dylandreimerink
Copy link
Member

The L4LB is hitting a flake described in #31167. Rebasing onto the lastest main commit should resolve the issue.

@dylandreimerink dylandreimerink added the dont-merge/needs-rebase This PR needs to be rebased because it has merge conflicts. label Mar 13, 2024
cilium-agent periodically checks the connectivity to the k8s api-server by
"kubernetes" probe. cachedVersion() returns a cached value of the k8s version to the
probe if not expired or invalid.

The logic for evaluating the validity of the cache is as follows:
1. check if the api-server connectivity is healthy. If the last check was more than
k8sMinimumEventHeartbeat(default: 1m) ago, then valid=false is returned.
2. if the api-server connectivity is given, returns valid=false if the last check was
more than k8sVersionCheckInterval(default: 15m) ago.
3. otherwise returns the cached value and valid=true.

Currently 'k8smetrics.LastInteraction.Time()' is used in the step 1, which is updated
periodically regardless of whether the api-server connectivity is alive or not.
This commit fixes it to use 'k8smetrics.LastSuccessInteraction.Time()' instead.

Signed-off-by: naoki-take <naoki-take@cybozu.co.jp>
auto-merge was automatically disabled March 19, 2024 06:55

Head branch was pushed to by a user without write access

@tkna
Copy link
Contributor Author

tkna commented Mar 19, 2024

@dylandreimerink Rebased to main.

@dylandreimerink dylandreimerink removed the dont-merge/needs-rebase This PR needs to be rebased because it has merge conflicts. label Mar 20, 2024
@dylandreimerink
Copy link
Member

/test

Copy link
Contributor

@squeed squeed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch :-)

@squeed squeed enabled auto-merge March 22, 2024 08:51
@squeed squeed added this pull request to the merge queue Mar 22, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Mar 22, 2024
Merged via the queue into cilium:main with commit 8c1ae0b Mar 22, 2024
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/community-contribution This was a contribution made by a community member. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/bug This PR fixes an issue in a previous release of Cilium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants