-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add k8s endpoint check to markNodeReady #615
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think this is what we need here. The onStart
hook runs every time k8sd starts. Will this not remove the kubeconfigs of a running cluster?
right, I didn't think about that. what if we run the csrsigning controller in |
Perhaps an alternative would be to block the csrsigning controller starting before we can validate that we have a proper kubeconfig in place |
For example, we could return the rest config from here
/readyz or a GetNode() ), otherwise keep looping.
e.g. here is what we do on bootstrap (without the loop, as we don't want to keep using stale kubeconfigs) k8s-snap/src/k8s/pkg/client/kubernetes/status.go Lines 17 to 19 in db5015e
|
e38c628
to
462de75
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going in the right direction, but let's keep things simple rather than add layers on top of layers
c7c8726
to
025f0b8
Compare
adding a centralized wait didn't seem to be possible. in order to mark the node as ready |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
7c1ab31
to
cf1832a
Compare
Summary
onStart
hook happens beforeonBootstrap
. because of this, on non-fresh machines (non-fresh ==/etc/kubernetes/admin.conf
is available) we use invalid/oldadmin.conf
kubeconfig for csrsigining controller client. this PR makes sure that we prevent running controllers until we have the correct.conf
files and we can reach the k8s cluster.How to test
build and install k8s on a fresh machine, run
bootstrap
and check logs and confirm the csrsigning controller is running, e.g.:also confirm that there are kubeconfigs available in
/etc/kubernetes/
, specificallyadmin.conf
.now remove the k8s snap and reinstall k8s (same snap). Run
bootstrap
and like above confirm that csrsigning controller is started and running.