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

kubeadm: implementation of UpgradeConfiguration API types #114062

Closed
wants to merge 9 commits into from

Conversation

chendave
Copy link
Member

@chendave chendave commented Nov 22, 2022

Signed-off-by: Dave Chen [email protected]

/kind feature

What type of PR is this?

What this PR does / why we need it:

Which issue(s) this PR fixes:

Part of #kubernetes/kubeadm#2489
Part of #kubernetes/kubeadm#2890

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

https://docs.google.com/document/d/1R4zLtgDadNM8_N2VzS0DI2mADcYmkyJ3L7lJVpbyZsA

TODO:

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. kind/feature Categorizes issue or PR as related to a new feature. labels Nov 22, 2022
@k8s-ci-robot
Copy link
Contributor

Please note that we're already in Test Freeze for the release-1.26 branch. This means every merged PR will be automatically fast-forwarded via the periodic ci-fast-forward job to the release branch of the upcoming v1.26.0 release.

Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Tue Nov 22 03:29:08 UTC 2022.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 22, 2022
@k8s-ci-robot k8s-ci-robot added area/kubeadm do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 22, 2022
@k8s-ci-robot
Copy link
Contributor

@chendave: This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot k8s-ci-robot added needs-priority Indicates a PR lacks a `priority/foo` label and requires one. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 22, 2022
@chendave
Copy link
Member Author

chendave commented Nov 22, 2022

/hold

  • going to be migrated to v1beta4 when the API version is ready.
  • will split into couple of commits as this pr contains several cleanup as well.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 22, 2022
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 15, 2022
@chendave chendave force-pushed the POC_upgradeCfg branch 2 times, most recently from a0b4567 to d230a11 Compare February 10, 2023 06:13
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 10, 2023
@chendave
Copy link
Member Author

Just took some time to rebase, and also cc to all active contributor to level up the visibility. @pacoxu @SataQiu @neolit123

Basically, the change to support resetCfg (#113583) and the upgradeCfg (#114062) is ready.

I understood we still need to wait for new API ready or well prepared in the advance, I would appreciated for any early review / comments for those two change.

@pacoxu
Copy link
Member

pacoxu commented Feb 13, 2023

If I understand correctly, the comments in https://docs.google.com/document/d/1R4zLtgDadNM8_N2VzS0DI2mADcYmkyJ3L7lJVpbyZsA/edit# shows that we should add new API in new API version v1beta4.

@chendave
Copy link
Member Author

If I understand correctly, the comments in https://docs.google.com/document/d/1R4zLtgDadNM8_N2VzS0DI2mADcYmkyJ3L7lJVpbyZsA/edit# shows that we should add new API in new API version v1beta4.

yes, migrate to the new API should be easy.

@pacoxu
Copy link
Member

pacoxu commented Feb 14, 2023

yes, migrate to the new API should be easy.

Do you mean that we can start reviewing this PR now or we should wait until this is migrated to the new API?
Is this targeted for v1.27 or the next release cycle(maybe v1.28)?

@chendave
Copy link
Member Author

@pacoxu pls help to review if you have some bandwidth or else it is fine to defer this to a future release cycle. AFAIK, this is not targeted for any version yet.

@SataQiu
Copy link
Member

SataQiu commented Feb 16, 2023

If I understand correctly, the comments in https://docs.google.com/document/d/1R4zLtgDadNM8_N2VzS0DI2mADcYmkyJ3L7lJVpbyZsA/edit# shows that we should add new API in new API version v1beta4.

Yes, v1beta3 is locked and new features cannot be added. Maybe we should first update KEP: https:/kubernetes/enhancements/tree/master/keps/sig-cluster-lifecycle/kubeadm/970-kubeadm-config

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 22, 2023
@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 20, 2023
@chendave
Copy link
Member Author

update 10/20/23

  • address @neolit123 's comments
  • added two separate commits for refactor 8777059 and 65f5152
  • re-org each commits and cleanup all unnecessary changes.

Overall, the big change for this update is refactoring, I did my best to make those changes easier to review.

@neolit123 @pacoxu @SataQiu PTAL when you got a chance, thanks!

@chendave
Copy link
Member Author

/retest-required

klog.V(1).Info("running preflight checks")
if err := runPreflightChecks(client, ignorePreflightErrorsSet, printer); err != nil {
return nil, nil, nil, err
}
Copy link
Member Author

Choose a reason for hiding this comment

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

this diff is necessary, I must move this code block up before the call to FetchInitConfigurationFromCluster, so that the interaction with cluster will not happen, this is because some testcases want to check the logic around this runPreflightChecks.

see this testcase:
cmd/kubeadm/app/cmd/upgrade TestEnforceRequirements/Fail_pre-flight_check

and the log from here: https://storage.googleapis.com/kubernetes-jenkins/pr-logs/pull/114062/pull-kubernetes-unit/1715315999886020608/build-log.txt

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 30, 2023
…ration`

Instead of load from config file to populate `InitConfiguration`,
the config file is expected to hold the config for upgrade only.

The old logic is that if the config file has "initConfiguration/
ClusterConfiguration" defined, then it assumes that user wants to
reconfigure the cluster based on the new configuration.

upgrade itself should be non-mutable, so the logic to `reconfigure`
will not be supported, and the init config should be fetched from
cluster instead.

Signed-off-by: Dave Chen <[email protected]>
The function use to load "InitConfiguration/ClusterConfiguration/
componentConfig" from a config file, now that we have a `upgradeConfiguration`
API, the function `loadConfig` can be removed now.

Signed-off-by: Dave Chen <[email protected]>
Those constants will be used for `kubeadm upgrade plan` or `kubeadm upgrade apply`

Signed-off-by: Dave Chen <[email protected]>
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 2, 2023
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 16, 2023
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

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.

@dims dims added the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Jan 4, 2024
@chendave
Copy link
Member Author

Just note I don't have time on this at the moment, someone else can help to continue the efforts as it's pretty close I believe, or else I can come back to this when some mess from me are all settled.

@calvin0327
Copy link

@chendave I'm interested in this, can I work on this?

@neolit123
Copy link
Member

closing in favor of #123068
thanks for the work on this!

@neolit123
Copy link
Member

/close

@k8s-ci-robot
Copy link
Contributor

@neolit123: Closed this PR.

In response to this:

/close

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. area/kubeadm cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants