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

🐛 move the rebootstrap logic to registration agent #267

Conversation

elgnay
Copy link
Contributor

@elgnay elgnay commented Sep 5, 2023

When the initial bootstrap hub kubeconfig is invalid, for example with wrong proxy settings, the bootstrap will not succeed and no hub kubeconfig will be created. Once a new bootstrap hub kubeconfig is provided by updating the bootstrap-kubeconfig-secret, the rebootstrapping will not be triggered because the klusterlet operator does not know if the bootstrap hub kubeconfig has changed.

By adding a new health checker, the agent will restart once bootstrap hub kubeconfig secret changes. That fix the issue described above. Another health checker is added as well to restart agent when the client certificate become expired.

Summary

Related issue(s)

Fixes #

@elgnay
Copy link
Contributor Author

elgnay commented Sep 5, 2023

/hold

@codecov
Copy link

codecov bot commented Sep 5, 2023

Codecov Report

Attention: 59 lines in your changes are missing coverage. Please review.

Comparison is base (5903140) 61.06% compared to head (abfda59) 61.13%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #267      +/-   ##
==========================================
+ Coverage   61.06%   61.13%   +0.06%     
==========================================
  Files         129      129              
  Lines       13771    13661     -110     
==========================================
- Hits         8409     8351      -58     
+ Misses       4588     4549      -39     
+ Partials      774      761      -13     
Flag Coverage Δ
unit 61.13% <55.30%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
pkg/operator/helpers/helpers.go 61.66% <ø> (ø)
...usterletcontroller/klusterlet_runtime_reconcile.go 54.65% <100.00%> (-1.89%) ⬇️
pkg/registration/spoke/options.go 58.92% <68.18%> (+1.03%) ⬆️
pkg/registration/spoke/health_checker.go 67.18% <67.18%> (ø)
pkg/registration/spoke/spokeagent.go 15.44% <29.54%> (+1.11%) ⬆️

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@elgnay elgnay force-pushed the terminate-on-bootstrpkubeconfig branch from ee94897 to fa91d13 Compare September 5, 2023 11:05
@elgnay elgnay closed this Sep 5, 2023
@elgnay elgnay reopened this Sep 5, 2023
@elgnay elgnay force-pushed the terminate-on-bootstrpkubeconfig branch from fa91d13 to f2c3e19 Compare September 15, 2023 03:46
@elgnay elgnay changed the title 🐛 terminate agent once bootstrap hub kubeconfig changes 🐛 move the rebootstrap logic to registration agent Sep 15, 2023
@elgnay elgnay force-pushed the terminate-on-bootstrpkubeconfig branch from f2c3e19 to cae4ce2 Compare September 15, 2023 03:54
@elgnay elgnay force-pushed the terminate-on-bootstrpkubeconfig branch from cae4ce2 to e34e716 Compare September 25, 2023 11:31
@elgnay elgnay force-pushed the terminate-on-bootstrpkubeconfig branch 3 times, most recently from 79a095d to 9c13dac Compare September 25, 2023 12:55
@elgnay elgnay closed this Sep 25, 2023
@elgnay elgnay reopened this Sep 25, 2023
@elgnay elgnay force-pushed the terminate-on-bootstrpkubeconfig branch from 9c13dac to b000388 Compare October 12, 2023 07:05
@elgnay elgnay force-pushed the terminate-on-bootstrpkubeconfig branch 5 times, most recently from 5ed032f to 4df38d3 Compare October 16, 2023 12:45
@elgnay elgnay closed this Oct 16, 2023
@elgnay elgnay reopened this Oct 16, 2023
@elgnay elgnay force-pushed the terminate-on-bootstrpkubeconfig branch from 4df38d3 to d2993e8 Compare October 17, 2023 00:42
@elgnay elgnay closed this Oct 17, 2023
@elgnay elgnay reopened this Oct 17, 2023
@elgnay elgnay closed this Oct 17, 2023
@elgnay elgnay reopened this Oct 17, 2023
@elgnay elgnay force-pushed the terminate-on-bootstrpkubeconfig branch 2 times, most recently from 4e04a07 to 085b461 Compare October 18, 2023 06:45
@elgnay elgnay force-pushed the terminate-on-bootstrpkubeconfig branch from 085b461 to abfda59 Compare October 18, 2023 07:54
@qiujian16
Copy link
Member

/approve
/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 18, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: elgnay, qiujian16

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@skeeey
Copy link
Member

skeeey commented Oct 18, 2023

/unhold

@openshift-ci openshift-ci bot merged commit 9aaa132 into open-cluster-management-io:main Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants