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 v1beta1: InitConfiguration.APIEndpoint -> LocalAPIEndpoint #70761

Merged
merged 3 commits into from
Nov 9, 2018

Conversation

luxas
Copy link
Member

@luxas luxas commented Nov 7, 2018

What type of PR is this?

Uncomment only one, leave it on its own line:

/kind api-change

/kind bug
/kind cleanup
/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake

What this PR does / why we need it:

As discussed in today's SIG meeting, LocalAPIEndpoint makes more sense than APIEndpoint which is more generic. The value is specific to the current master being initialized, and is different from ControlPlaneEndpoint which refers to the public endpoint for all API servers. This change targets the upcoming v1beta1 Config API.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

kubeadm v1beta1 API: InitConfiguration.APIEndpoint has been renamed to .LocalAPIEndpoint

@kubernetes/sig-cluster-lifecycle-pr-reviews

@luxas luxas added this to the v1.13 milestone Nov 7, 2018
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API size/L Denotes a PR that changes 100-499 lines, ignoring generated files. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. approved Indicates a PR has been approved by an approver from all required OWNERS files. area/kubeadm labels Nov 7, 2018
@luxas
Copy link
Member Author

luxas commented Nov 7, 2018

/priority important-soon

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Nov 7, 2018
Copy link
Member

@timothysc timothysc left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

docs can be cleaned up later.

// APIEndpoint represents the endpoint of the instance of the API server to be deployed on this node.
APIEndpoint APIEndpoint
// LocalAPIEndpoint represents the endpoint of the API server instance that's deployed on this control plane node
// In HA setups, this differ from ClusterConfiguration.ControlPlaneEndpoint in the sense that ControlPlaneEndpoint
Copy link
Member

Choose a reason for hiding this comment

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

differs
or is different

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@timothysc
Copy link
Member

/test pull-kubernetes-verify
/test pull-kubernetes-bazel-test

@timothysc
Copy link
Member

/hold
@fabriziopandini - in case you have any comments on the naming.

@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 8, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: luxas, timothysc

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
Copy link
Member

should this be considered as "action required" item?

@fabriziopandini
Copy link
Member

I'm fine with prefixing with Local if it helps with clarification.
Only wondering if we need to rename also ClusterStatus.APIEndpoints --> ClusterStatus.LocalAPIEndpoints for consistency

@timothysc @luxas @rosti @neolit123 opinions? quick thumbs up/down?

Copy link
Contributor

@rosti rosti left a comment

Choose a reason for hiding this comment

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

@luxas thanks for this change! It's nice to have you back!

I do think, that we should actually extend this to cover JoinConfiguration.APIEndpoint -> LocalAPIEndpoint too. Although, that can be done in another PR.

@fabriziopandini IDK about APIEndpoints vs LocalAPIEndpoints. Both ways seem descriptive enough in its context.

@@ -49,7 +49,7 @@ func ValidateInitConfiguration(c *kubeadm.InitConfiguration) field.ErrorList {
allErrs = append(allErrs, ValidateNodeRegistrationOptions(&c.NodeRegistration, field.NewPath("nodeRegistration"))...)
allErrs = append(allErrs, ValidateBootstrapTokens(c.BootstrapTokens, field.NewPath("bootstrapTokens"))...)
allErrs = append(allErrs, ValidateClusterConfiguration(&c.ClusterConfiguration)...)
allErrs = append(allErrs, ValidateAPIEndpoint(&c.APIEndpoint, field.NewPath("apiEndpoint"))...)
allErrs = append(allErrs, ValidateAPIEndpoint(&c.LocalAPIEndpoint, field.NewPath("apiEndpoint"))...)
Copy link
Contributor

Choose a reason for hiding this comment

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

The field path also needs to be changed here to localAPIEndpoint

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@timothysc
Copy link
Member

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 8, 2018
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 8, 2018
@luxas
Copy link
Member Author

luxas commented Nov 8, 2018

I do think, that we should actually extend this to cover JoinConfiguration.APIEndpoint -> LocalAPIEndpoint

@fabriziopandini will implement this, along with changing JoinConfiguration.ControlPlane to be a pointer struct

@timothysc
Copy link
Member

/test pull-kubernetes-verify

@neolit123
Copy link
Member

neolit123 commented Nov 9, 2018

the verify failures could be due to golang 1.11.x.
@luxas latest golang with ./hack/update-gofmt .sh should fix it.

@luxas
Copy link
Member Author

luxas commented Nov 9, 2018

@neolit123 yeah I rebased and fixed that in the latest push
Please re-apply the label

@neolit123
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 9, 2018
@timothysc
Copy link
Member

@luxas please squash to 2 and tests appear broken.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel comment for consistent failures.

@k8s-ci-robot k8s-ci-robot merged commit 54fe139 into kubernetes:master Nov 9, 2018
Copy link
Member

@liggitt liggitt left a comment

Choose a reason for hiding this comment

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

Is this related to
#70907 ?

// configuration object lets you customize what IP/DNS name and port the local API server advertises it's accessible
// on. By default, kubeadm tries to auto-detect the IP of the default interface and use that, but in case that process
// fails you may set the desired value here.
LocalAPIEndpoint APIEndpoint `json:"localAPIEndpoint,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

Was the old field shipped and persisted previously? If so, what will happen if a previously serialized config file is read and the old apiEndpoint field is discarded and the new localAPIEndpoint field is empty?

Copy link
Member

Choose a reason for hiding this comment

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

yep, it was shipped as part of the previous config version v1alpha3.

if an old config YAML is read and the old field is found, it should be converted to the new field.
https://github.com/kubernetes/kubernetes/pull/70761/files#diff-628349c40af3952df65127e8449c04e2R31

kubeadm 1.13 would support both v1alpha3 and v1beta1.

Copy link
Member

Choose a reason for hiding this comment

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

I specifically meant if v1beta1 was shipped in a previous release with this field. If another version of the config was shipped, but handles conversion, that's fine

Copy link
Member

Choose a reason for hiding this comment

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

yep, v1beta1 would be shipped for the first time in 1.13.

@neolit123
Copy link
Member

neolit123 commented Nov 11, 2018

Is this related to
#70907 ?

@liggitt we merged an e2e fix 11 hours ago. :)

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. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. 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.

None yet

8 participants