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

Refactor the upgrade process to stop using config on upgrade #3251

Merged
merged 1 commit into from
Jun 23, 2024

Conversation

xmudrii
Copy link
Member

@xmudrii xmudrii commented Jun 20, 2024

What this PR does / why we need it:

This PR refactors the cluster upgrade process to adhere to recommendations from the upstream community. With that, using the --config flag along with the kubeadm upgrade apply command:

  • is strictly discouraged because of possible side effects affecting the cluster stability
  • is deprecated and partially removed as of Kubernetes 1.30 and will be completely removed with Kubernetes 1.31

kubeadm writes configuration to different ConfigMaps in the kube-system namespace, mainly kubeadm-config, kubelet-config, and kube-proxy. The recommended workflow is to update the needed ConfigMap and then run the appropriate kubeadm command as described in the document.

Upon initiating the upgrade process, KubeOne will build the Kubernetes clientset, generate new Kubeadm configs and update all the ConfigMaps used by Kubeadm. Kubeadm will reconfigure the cluster as needed based on what's changed (if anything is changed at all).

This however means that some options are now immutable, but most of them should not be user-facing, and I don't think we ever supported changing these options:

  • Anything in InitConfiguration and JoinConfiguration structs. There is .LocalAPIEndpoint.AdvertiseAddress, but I don't think we support changing the IP address of existing control plane or worker nodes

Which issue(s) this PR fixes:
xref #3205

What type of PR is this?

/kind feature
/kind design

Special notes for your reviewer:

In the future, we should refactor the force upgrade process to work in a reconciliation manner, i.e. to avoid running the full upgrade process, but only compare what's changed and regenerate only those affected manifests.

Does this PR introduce a user-facing change? Then add your Release Note here:

Refactor the cluster upgrade process to adhere to the [Kubernetes recommendations](https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-reconfigure/) by updating ConfigMaps used by Kubeadm instead of providing the full config to Kubeadm itself. This change should not have any effect to cluster upgrades, but if you encounter any issue, please create an issue in our repository

Documentation:

NONE

@kubermatic-bot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kubermatic-bot kubermatic-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. do-not-merge/docs-needed Indicates that a PR should not merge because it's missing one of the documentation labels. kind/design Categorizes issue or PR as related to design. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 20, 2024
@xmudrii
Copy link
Member Author

xmudrii commented Jun 20, 2024

/test all

@xmudrii xmudrii requested a review from kron4eg June 20, 2024 16:31
Copy link
Member

@kron4eg kron4eg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All in all, I like the idea.

@xmudrii xmudrii force-pushed the refactor-upgrades branch 2 times, most recently from 6a2cf7e to 4bff91e Compare June 21, 2024 13:52
Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>
@xmudrii xmudrii marked this pull request as ready for review June 21, 2024 14:20
@kubermatic-bot kubermatic-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 21, 2024
@xmudrii
Copy link
Member Author

xmudrii commented Jun 21, 2024

/cherrypick release/v1.8

@kubermatic-bot
Copy link
Contributor

@xmudrii: once the present PR merges, I will cherry-pick it on top of release/v1.8 in a new PR and assign it to you.

In response to this:

/cherrypick release/v1.8

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@xmudrii xmudrii requested a review from kron4eg June 21, 2024 14:20
@kubermatic-bot kubermatic-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. docs/none Denotes a PR that doesn't need documentation (changes). and removed do-not-merge/docs-needed Indicates that a PR should not merge because it's missing one of the documentation labels. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jun 21, 2024
@kron4eg
Copy link
Member

kron4eg commented Jun 23, 2024

/lgtm
/approve

@kubermatic-bot kubermatic-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 23, 2024
@kubermatic-bot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 20d9d6a9ae373f0a41cf2dc083f1f5ee8ec94eda

@kubermatic-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kron4eg

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

@kubermatic-bot kubermatic-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 23, 2024
@kubermatic-bot kubermatic-bot merged commit 3e3159e into main Jun 23, 2024
14 checks passed
@kubermatic-bot kubermatic-bot added this to the KubeOne 1.9 milestone Jun 23, 2024
@kubermatic-bot kubermatic-bot deleted the refactor-upgrades branch June 23, 2024 20:04
@kubermatic-bot
Copy link
Contributor

@xmudrii: new pull request created: #3253

In response to this:

/cherrypick release/v1.8

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. docs/none Denotes a PR that doesn't need documentation (changes). kind/design Categorizes issue or PR as related to design. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants