Skip to content

In-place update support in CAPBK #13498

@sm4ll-3gg

Description

@sm4ll-3gg

What would you like to be added (User Story)?

As a runtime hooks developer want to be able to "re-bootstrap" the node during in-place update

Detailed Description

Relates to #13497. The current issue describes the same case from the bootstrap provider pov.

Context
We use machine images for server provisioning and we strive to stick to the immutable infrastructure approach wherever possible. During the last setup phase, in cloud-init, a bootstrap token is used to generate certificates that are used by kubelet to authorize with kube-apiserver. So, in order to be able to update a server via resetup, we prefer to re-bootstrap the node. All we need is a fresh bootstrap token and, probably, updated cloud-init to be able to change most of KubeadmConfig params

Problems

  • Bootstrap token. CAPBK stops refreshing it once the node appears in the cluster. So, it's most likely expired when the update starts
  • Data secret. CAPBK renders KubeadmConfig into cloud-init only once, and it will never be updated without dirty manual intervention
  • Kubelet handles join of the node with the same name correctly, but it updates only subset of fields, so it won't be possible to update params that affect the node's manifest (as far as I understand). Code: https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/kubelet_node_status.go#L85-L142

Suggestion
I believe the following changes would be useful for CAPBK:

  • Regenerate data secret if the KubeadmConfig is updated during in-place update
  • Refresh the bootstrap token until in-place update is successfully completed

Regarding node re-registration by kubelet, I think that it could be left to the hooks developers to decide what fields can be updated in-place. I'm not sure this is the best solution, but I guess it won't make things worse and can be reassessed in the future

Anything else you would like to add?

No response

Label(s) to be applied

/kind feature
/area bootstrap
/area machine
One or more /area label. See https://github.com/kubernetes-sigs/cluster-api/labels?q=area for the list of labels.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/bootstrapIssues or PRs related to bootstrap providersarea/machineIssues or PRs related to machine lifecycle managementkind/featureCategorizes issue or PR as related to a new feature.needs-priorityIndicates an issue lacks a `priority/foo` label and requires one.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions