-
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
Cleanup on failed k8s bootstrap
an k8s join-cluster
attempts
#521
Conversation
c544f4f
to
7853340
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.
LGTM
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"k8s.io/client-go/util/retry" | ||
) | ||
|
||
// DeleteNode will remove a node from the kubernetes cluster. | ||
// DeleteNode will retry if there is a conflict on the resource. | ||
// DeleteNode will not fail if the node does not |
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.
nit: comment incomplete
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.
a4bcbb6
to
3620fba
Compare
7853340
to
ba8e00c
Compare
* cleanup on failed bootstrap * cleanup on failed worker join * create a local microcluster client on App * start cleanup on control plane join * do not block remove hook
Summary
Merge after #520
Changes
k8s bootstrap
, remove all configs, stop control plane services, then useResetClusterMember
. This resets the microcluster state. Note that this runs automatically by k8sd, no manual action from the client is required.k8s join-cluster
for worker nodes, similarly revert configs, then useResetClusterMember
k8s join-cluster
for control plane nodes: When thepostJoin
hook runs, the node has already joined microcluster. Therefore, we need to revert configs, but also make sure to useDeleteClusterMember
, such that the failed node is removed from the cluster before resetting.Notes
k8s remove-node
command, instead of delaying the completion of thek8s join-cluster
command.