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: Don't load deprecated configs #74025

Merged
merged 1 commit into from Feb 19, 2019

Conversation

@rosti
Copy link
Member

rosti commented Feb 13, 2019

What type of PR is this?
/kind cleanup

What this PR does / why we need it:

Currently kubeadm supports a couple of configuration versions - v1alpha3 and v1beta1. The former is deprecated, but still supported.

To discourage users from using it and to speedup conversion to newer versions, we disable the loading of deprecated configurations by all kubeadm sub-commands, but "kubeadm config migrate".

v1alpha3 is still present and supported at source level, but cannot be used directly with kubeadm and some of its internal APIs.

The added benefit to this is, that users won't need to lookup for an old kubeadm binary after upgrade, just because they were stuck with a deprecated config version for too long.

To achieve this, the following was done:

  • ValidateSupportedVersion now has an allowDeprecated boolean parameter, that controls if the function should return an error upon detecting deprecated config version. Currently the only deprecated version is v1alpha3.

  • ValidateSupportedVersion is made package private, because it's not used outside of the package anyway.

  • BytesToInitConfiguration and LoadJoinConfigurationFromFile are modified to disallow loading of deprecated kubeadm config versions. An error message, that points users to kubeadm config migrate is returned.

  • MigrateOldConfig is still allowed to load deprecated kubeadm config versions.

  • A bunch of tests were fixed to not expect success if v1alpha3 config is supplied.

Which issue(s) this PR fixes:

Refs kubernetes/kubeadm#1296

Special notes for your reviewer:

Depends on #74024 . Please, review only the last commit here.

/cc @kubernetes/sig-cluster-lifecycle-pr-reviews
/area kubeadm
/assign @neolit123
/assign @fabriziopandini

Does this PR introduce a user-facing change?:

kubeadm no longer allows using v1alpha3 configs for anything else than converting them to v1beta1.
@rosti

This comment has been minimized.

Copy link
Member Author

rosti commented Feb 13, 2019

/priority important-longterm

@rosti rosti changed the title Deprecated configs kubeadm: Deprecated configs Feb 13, 2019

@rosti rosti changed the title kubeadm: Deprecated configs kubeadm: Don't load deprecated configs Feb 13, 2019

@neolit123
Copy link
Member

neolit123 left a comment

thanks for this PR @rosti

Show resolved Hide resolved cmd/kubeadm/app/util/config/common.go Outdated

@rosti rosti force-pushed the rosti:deprecated-configs branch 3 times, most recently from 23a2e01 to 2891eee Feb 14, 2019

@neolit123
Copy link
Member

neolit123 left a comment

thanks for the update for validateSupportedVersion !

/approve
/hold

@yagonobre
Copy link
Member

yagonobre left a comment

Well done @rosti, thanks!
/lgtm
/test pull-kubernetes-kubemark-e2e-gce-big

@k8s-ci-robot k8s-ci-robot added the lgtm label Feb 15, 2019

@yagonobre

This comment has been minimized.

Copy link
Member

yagonobre commented Feb 15, 2019

/test pull-kubernetes-e2e-gce

@fabriziopandini

This comment has been minimized.

Copy link
Contributor

fabriziopandini commented Feb 18, 2019

@rosti thanks for this PR
/approve
/lgtm

@neolit123 is it ok for you to remove hold for this PR

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

k8s-ci-robot commented Feb 18, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini, neolit123, rosti

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

@neolit123

This comment has been minimized.

Copy link
Member

neolit123 commented Feb 18, 2019

@neolit123 is it ok for you to remove hold for this PR

yes, certainly.
/hold cancel

PR needs rebase.

edit: the related PR is in queue for merge.

kubeadm: Don't load deprecated configs
Currently kubeadm supports a couple of configuration versions - v1alpha3 and
v1beta1. The former is deprecated, but still supported.

To discourage users from using it and to speedup conversion to newer versions,
we disable the loading of deprecated configurations by all kubeadm
sub-commands, but "kubeadm config migrate".

v1alpha3 is still present and supported at source level, but cannot be used
directly with kubeadm and some of its internal APIs.

The added benefit to this is, that users won't need to lookup for an old
kubeadm binary after upgrade, just because they were stuck with a deprecated
config version for too long.

To achieve this, the following was done:

- ValidateSupportedVersion now has an allowDeprecated boolean parameter, that
  controls if the function should return an error upon detecting deprecated
  config version. Currently the only deprecated version is v1alpha3.

- ValidateSupportedVersion is made package private, because it's not used
  outside of the package anyway.

- BytesToInitConfiguration and LoadJoinConfigurationFromFile are modified to
  disallow loading of deprecated kubeadm config versions. An error message,
  that points users to kubeadm config migrate is returned.

- MigrateOldConfig is still allowed to load deprecated kubeadm config versions.

- A bunch of tests were fixed to not expect success if v1alpha3 config is
  supplied.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>

@rosti rosti force-pushed the rosti:deprecated-configs branch from 9ef6fcc to f64baf7 Feb 19, 2019

@neolit123
Copy link
Member

neolit123 left a comment

/lgtm

if there are no more comments, we can hold cancel tomorrow.
edit: no need.

@neolit123

This comment has been minimized.

Copy link
Member

neolit123 commented Feb 19, 2019

/hold cancel

@k8s-ci-robot k8s-ci-robot merged commit 8d69dc6 into kubernetes:master Feb 19, 2019

17 checks passed

cla/linuxfoundation rosti authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-cross Skipped
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-godeps Skipped
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped
pull-kubernetes-local-e2e-containerized Skipped
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
pull-publishing-bot-validate Skipped
tide In merge pool.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.