Feature: Adds reconfigure control plane#11871
Feature: Adds reconfigure control plane#11871Hector295 wants to merge 1 commit intokubernetes-sigs:masterfrom
Conversation
|
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. DetailsInstructions 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-sigs/prow repository. |
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Hector295 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @Hector295! |
|
Hi @Hector295. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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-sigs/prow repository. |
|
Hum, could you explain the difference with I'm not completely closed to the idea, but IMO this would be best implemented with limit and tags / a more intelligent playbook (== we probably restart some things a bit eagerly). |
|
Hi @VannTen , thank you for your comment and for taking the time to review this PR. The command you mentioned ( What I’ve implemented follows the official Kubernetes documentation, which outlines the correct process to ensure changes are properly reflected in the cluster. Regarding your suggestion about Additionally, I tested this implementation by changing the value of It’s also worth noting that the behavior of using the |
|
/ok-to-test |
|
@Hector295: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions 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-sigs/prow repository. I understand the commands that are listed here. |
Is that recent ? Because it absolutely should reconfigure the control-plane, and it does on older releases (like, I did this yesterday on 1.25 to add OIDC parameters.
I agree that tags are not strictly necessary. I was working from the assumption that you meant to minimize cluster disruption by only changing the configuration, but if upgrade-cluster is no longer updating configuration, I see where you're coming from.
I was distantly aware of this issue, but I haven't had the time to focus on this yet. I don't think a new playbook is the answer though, for several reasons:
Is there a specific reason upgrade-cluster.yml can't be fixed instead ? |
|
@VannTen the behavior you mentioned in 1.25 worked, but it was not the correct approach according to kubeadm's design. The upgrade-cluster functionality was being used to reconfigure the control plane, even though its actual purpose is to manage cluster version upgrades. |
Adds revised support for: - The previously removed `--config` argument for `kubeadm upgrade apply` - Changes to `ClusterConfiguration` as part of the `upgrade-cluster.yml` playbook lifecycle (Fixes kubernetes-sigs#11552) - kubeadm-config `v1beta4` `UpgradeConfiguration` for the `kubeadm upgrade apply` command: [UpgradeConfiguration v1beta4](https://kubernetes.io/docs/reference/config-api/kubeadm-config.v1beta4/#kubeadm-k8s-io-v1beta4-UpgradeConfiguration). Background: PR kubernetes-sigs#11352 removed the --config flag from `kubeadm upgrade apply` to address the upgrade issues with kubeadm v1.30 identified in kubernetes-sigs#11350. Before this change, kubespray upgrades depended on `kubeadm upgrade apply --config=...` to make ClusterConfiguration changes with the upgrade. However, this reconfiguration was deprecated in `kubeadm upgrade apply` some time ago, and is no longer supported by the `kubeadm upgrade apply` config command. To ensure `ClusterConfiguration` changes are still applied during upgrades in a supportable way, the new solution in this PR reconfigures ClusterConfiguration separately after upgrade with distinct upload-config and control plane static pod rewrite tasks that run immediately after a successful upgrade. See [this comment from @VannTen](kubernetes-sigs#11871 (comment)) for more discussion on why the expectation is to fix reconfiguration as part of the upgrade lifecycle, as well as issue kubernetes-sigs#11552. Additionally, kubeadm v1.31 added back support for `--config`, along with UpgradeConfiguration when using v1beta4. This PR adds support for the `UpgradeConfiguration` in the kubeadm-config file, which is required to fully implement upgrades with `kubeadm.k8s.io/v1beta4`. This addition was omitted from the original v1beta4 implementation in kubernetes-sigs#11674, but it is required to use `--config` correctly during kubeadm upgrades with v1beta4.
Adds revised support for: - The previously removed `--config` argument for `kubeadm upgrade apply` - Changes to `ClusterConfiguration` as part of the `upgrade-cluster.yml` playbook lifecycle (Fixes kubernetes-sigs#11552) - kubeadm-config `v1beta4` `UpgradeConfiguration` for the `kubeadm upgrade apply` command: [UpgradeConfiguration v1beta4](https://kubernetes.io/docs/reference/config-api/kubeadm-config.v1beta4/#kubeadm-k8s-io-v1beta4-UpgradeConfiguration). kubeadm upgrade apply --config support PR kubernetes-sigs#11352 removed the --config flag from all usages of `kubeadm upgrade apply` to address the upgrade issues with kubeadm v1.30 identified in kubernetes-sigs#11350. This PR enables support for the scenarios in which `--config` can and should still be used with `kubeadm upgrade apply`, with some version specific handling that still avoid kubeadm v1.30's upgrade failures. Control plane reconfiguration during upgrade Before PR kubernetes-sigs#11352, kubespray upgrades depended on `kubeadm upgrade apply --config=...` to make ClusterConfiguration changes during a cluster upgrade. However, this reconfiguration was deprecated from `kubeadm upgrade apply` some time ago, and is [no longer supported](https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade/#additional-information) by the `kubeadm upgrade apply` command. To ensure `ClusterConfiguration` changes are still applied during upgrades in a supportable way, the new solution in this PR reconfigures `ClusterConfiguration` separately with distinct `kubeadm init phase upload-config kubeadm --config=...` and control plane static pod rewrite tasks that run immediately after a successful upgrade. See [this comment from @VannTen](kubernetes-sigs#11871 (comment)) for more discussion on why the expectation is to fix reconfiguration as part of the upgrade lifecycle, as well as issue kubernetes-sigs#11552. This approach is in line with kubeadm's [recommendations for cluster reconfiguration](https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-reconfigure/). kubeadm-config v1beta4 `UpgradeApplyConfiguration` support Additionally, kubeadm v1.31 added back support for `--config` while introducing support for `UpgradeConfiguration` in the kubeadm-config file, which is required to fully implement upgrades with `kubeadm.k8s.io/v1beta4`. UpgradeConfiguration was not added in kubespray's initial v1beta4 implementation (PR kubernetes-sigs#11674), but it is required to use `--config` correctly during kubeadm upgrades with v1beta4. This PR uses UpgradeConfiguration for v1beta4 kubeadm upgrades, while still retaining support for v1beta3.
Adds revised support for: - The previously removed `--config` argument for `kubeadm upgrade apply` - Changes to `ClusterConfiguration` as part of the `upgrade-cluster.yml` playbook lifecycle - kubeadm-config `v1beta4` `UpgradeConfiguration` for the `kubeadm upgrade apply` command: [UpgradeConfiguration v1beta4](https://kubernetes.io/docs/reference/config-api/kubeadm-config.v1beta4/#kubeadm-k8s-io-v1beta4-UpgradeConfiguration). kubeadm upgrade apply --config support PR kubernetes-sigs#11352 removed the --config flag from all usages of `kubeadm upgrade apply` to address the upgrade issues with kubeadm v1.30 identified in kubernetes-sigs#11350. This PR enables support for the scenarios in which `--config` can and should still be used with `kubeadm upgrade apply`, with some version specific handling that still avoid kubeadm v1.30's upgrade failures. Control plane reconfiguration during upgrade Before PR kubernetes-sigs#11352, kubespray upgrades depended on `kubeadm upgrade apply --config=...` to make ClusterConfiguration changes during a cluster upgrade. However, this reconfiguration was deprecated from `kubeadm upgrade apply` some time ago, and is [no longer supported](https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade/#additional-information) by the `kubeadm upgrade apply` command. To ensure `ClusterConfiguration` changes are still applied during upgrades in a supportable way, the new solution in this PR reconfigures `ClusterConfiguration` separately with distinct `kubeadm init phase upload-config kubeadm --config=...` and control plane static pod rewrite tasks that run immediately after a successful upgrade. See [this comment from @VannTen](kubernetes-sigs#11871 (comment)) for more discussion on why the expectation is to fix reconfiguration as part of the upgrade lifecycle, as well as issue kubernetes-sigs#11552. This approach is in line with kubeadm's [recommendations for cluster reconfiguration](https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-reconfigure/). kubeadm-config v1beta4 `UpgradeApplyConfiguration` support Additionally, kubeadm v1.31 added back support for `--config` while introducing support for `UpgradeConfiguration` in the kubeadm-config file, which is required to fully implement upgrades with `kubeadm.k8s.io/v1beta4`. UpgradeConfiguration was not added in kubespray's initial v1beta4 implementation (PR kubernetes-sigs#11674), but it is required to use `--config` correctly during kubeadm upgrades with v1beta4. This PR uses UpgradeConfiguration for v1beta4 kubeadm upgrades, while still retaining support for v1beta3.
@VannTen Over the past week I have been testing a solution that applies reconfiguration in our upgrade tasks, adds support for Now that we have #12015 to fix reconfiguration during upgrades, I believe the scope of this PR does not need to satisfy the upgrade requirements. If the community feels there is value in introducing standalone reconfiguration playbooks that can be used outside of upgrades, we could definitely still consider this PR within that scope. Although, historically reconfiguration has been managed by rerunning |
|
Superseded by #12015 |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR introduces tasks and configurations that allow for the reconfiguration of the control plane (kube-apiserver, controller-manager, and scheduler) in Kubespray without requiring a full cluster reprovision.
Additionally, a new playbook,
reconfigure-control-plane.yml, has been added. To reconfigure an existing cluster without performing an upgrade, run:ansible-playbook -i <INVENTORY> reconfigure-control-plane.yml --skip-tags upgradeWhich issue(s) this PR fixes:
Fixes #11552
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Feature: Adds new tasks, templates, and a playbook (
reconfigure-control-plane.yml) for control plane reconfiguration in Kubespray, allowing incremental updates without requiring a full cluster reprovision.