-
Notifications
You must be signed in to change notification settings - Fork 142
Run token-watcher.sh in the background to refresh kubeconfig #577
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
Run token-watcher.sh in the background to refresh kubeconfig #577
Conversation
Pull Request Test Coverage Report for Build 13906708718Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
|
I think this approach is good to fix what we currently have, but ideally, we should refresh it in code once we get a 401 error. Is that what Calico does? |
45421a4 to
1a65b6c
Compare
Calico just rotate the token in kubeconfig if it is about to expire in Yeah ideally golang would be good. Now this is just a simple working version. |
|
LGTM Thanks @lubronzhan. Before I merge this, please organize the commits. Each one should have a relevant title and description. You could also squash them and have a single one. |
* Calls token-watcher.sh in background * Update the manifest
1dc0bf1 to
47db6d8
Compare

What this PR does / why we need it:
With current script, install-cni.sh will stuck in an infinite loop, not continue to ip-control-loop.
This PR extract the loop into a background process
token-watcher.shExample whereabouts log
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes ##575
Special notes for your reviewer (optional):
Other option would be like adding token refreshing using golang, like https://github.com/projectcalico/calico/pull/5910/files#diff-3bc859f09da6edba95b02904c6c5da879513d9d6e4c87e9c35ebc97b1afad6e6
Or rearchitect to thick model, having the shim binary talking to the whereabouts daemon through socket, instead of directly talking to apiserver