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

fix kubeadm init output #75420

Merged

Conversation

fabriziopandini
Copy link
Member

What type of PR is this?
/kind bug

What this PR does / why we need it:
This PR fixes a duplicated message in the kubeadm init output (You can now join any number of machines by running the following on each node as root repeated twice) and wrong indentation.

Additionally, now the join control-plane message is printed only when the preconditions for joining a control plane are satisfied:

kubeadm init output for cluster WITHOUT controlPlaneEndpoint --> join control-plane conditions not satisfied:

....
Then you can join any number of worker nodes by running the following on each as root:

kubeadm join 172.17.0.2:6443 --token abcdef.0123456789abcdef \
    --discovery-token-ca-cert-hash sha256:4d170b1dfb24229319e0439a052b3cb56d02b152fc5903a4e4753e4fa76f8aca

kubeadm init output for cluster WITH controlPlaneEndpoint, but created WITHOUT --upload-certs

....
You can now join any number of control-plane node by copying certificate authorities
and service account keys on each node and then running the following as root:

  kubeadm join 172.17.0.2:6443 --token abcdef.0123456789abcdef \
    --discovery-token-ca-cert-hash sha256:c2b92b4d0864ed76706f51962ab709f404d58874f8a5b7e7e8aa88fcfe8fc518 \
    --experimental-control-plane

Then you can join any number of worker nodes by running the following on each as root:

kubeadm join 172.17.0.2:6443 --token abcdef.0123456789abcdef \
    --discovery-token-ca-cert-hash sha256:c2b92b4d0864ed76706f51962ab709f404d58874f8a5b7e7e8aa88fcfe8fc518

kubeadm init output for cluster WITH controlPlaneEndpoint and WITH --upload-certs

....
You can now join any number of the control-plane node running the following command on each as a root:

  kubeadm join 172.17.0.4:6443 --token abcdef.0123456789abcdef \
    --discovery-token-ca-cert-hash sha256:65034066a1b500506b6e673a70da433e171ebda9201f1f3e2767c68417bb44f6 \
    --experimental-control-plane --certificate-key 0123456789012345678901234567890123456789012345678901234567890123

Please note that the certificate-key gives access to cluster sensitive data, keep it secret!
As a safeguard, uploaded-certs will be deleted in two hours; If necessary, you can use
"kubeadm init phase upload-certs" to reload certs afterward.

Then you can join any number of worker nodes by running the following on each as root:

kubeadm join 172.17.0.4:6443 --token abcdef.0123456789abcdef \
    --discovery-token-ca-cert-hash sha256:65034066a1b500506b6e673a70da433e171ebda9201f1f3e2767c68417bb44f6

Does this PR introduce a user-facing change?:

kubeadm: the kubeadm init output now provides join control-plane example only when the preconditions for joining a control plane are satisfied

/sig cluster-lifecycle
/priority critical-urgent
/milestone v1.14
/assign @neolit123
/assign @timothysc
/cc @yagonobre

@k8s-ci-robot k8s-ci-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Mar 16, 2019
@k8s-ci-robot k8s-ci-robot added this to the v1.14 milestone Mar 16, 2019
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. kind/bug Categorizes issue or PR as related to a bug. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. labels Mar 16, 2019
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 16, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini

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

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. area/kubeadm labels Mar 16, 2019
Copy link
Member

@neolit123 neolit123 left a comment

Choose a reason for hiding this comment

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

LGTM found two typo/nits.
thanks.

cmd/kubeadm/app/cmd/init.go Outdated Show resolved Hide resolved
cmd/kubeadm/app/cmd/init.go Outdated Show resolved Hide resolved
@fabriziopandini
Copy link
Member Author

fabriziopandini commented Mar 16, 2019

/test pull-kubernetes-kubemark-e2e-gce-big

Copy link
Member

@yagonobre yagonobre left a comment

Choose a reason for hiding this comment

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

cmd/kubeadm/app/cmd/init.go Outdated Show resolved Hide resolved
cmd/kubeadm/app/cmd/util/join.go Show resolved Hide resolved
cmd/kubeadm/app/cmd/util/join.go Outdated Show resolved Hide resolved
@xmudrii
Copy link
Member

xmudrii commented Mar 18, 2019

@fabriziopandini Hello! I'd like to remind that the Code Thaw is starting tomorrow, Tuesday PST EOD. Is it possible to get this PR reviewed and approved by then? Otherwise, the PR will have to compete with herd of other incoming PRs post-thaw.

@fabriziopandini
Copy link
Member Author

@xmudrii thanks for the heads up. we are rallying to get this in before code thaw

@neolit123 @yagonobre, all the comment are addressed

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 18, 2019
Copy link
Member

@neolit123 neolit123 left a comment

Choose a reason for hiding this comment

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

/lgtm

@neolit123
Copy link
Member

/retest

@k8s-ci-robot k8s-ci-robot merged commit b61baea into kubernetes:master Mar 18, 2019
@fabriziopandini fabriziopandini deleted the fix-kubeadm-init-output branch March 21, 2019 07:51
This pull request was closed.
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/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. 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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants