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 etcd connect for join --control-plane #71360

Merged
merged 1 commit into from
Nov 22, 2018

Conversation

fabriziopandini
Copy link
Member

What type of PR is this?
/kind bug

What this PR does / why we need it:
To fix kubeadm v1.13 error when joining a control plane node.

Which issue(s) this PR fixes:
kubernetes/kubeadm#1270

Special notes for your reviewer:
The error happens when connecting to etcd, and this problem is similar to what fixed by #70893 but gets triggered only during join control plane worflow

Does this PR introduce a user-facing change?:

NONE

/sig cluster-lifecycle
/priority critical-urgent
/milestone v1.13

/cc @timothysc
/cc @luxas
/cc @neolit123
@kubernetes/sig-cluster-lifecycle-pr-reviews

@k8s-ci-robot k8s-ci-robot added 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. labels Nov 22, 2018
@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 22, 2018
@k8s-ci-robot k8s-ci-robot added this to the v1.13 milestone Nov 22, 2018
@k8s-ci-robot k8s-ci-robot added priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 22, 2018
@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 Nov 22, 2018
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.

thanks for the quick fix @fabriziopandini
added one comment

oldManifest := false
klog.V(1).Infoln("checking etcd manifest")

etcdManifestFile := constants.GetStaticPodFilepath(constants.Etcd, constants.GetStaticPodDirectory())
etcdPod, err := staticpod.ReadStaticPodFromDisk(etcdManifestFile)
if err != nil {
return nil, errors.Wrap(err, "error reading etcd manifest file")
Copy link
Member

Choose a reason for hiding this comment

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

i think we still need to have the err != nil case.

Copy link
Member Author

Choose a reason for hiding this comment

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

The fact is that in case join --control-plane we have an error by design (because the etcd pod doesn't exist)

This is why I changed the logic in "if an etcd manifests exists and I can parse it, then ....else try to connect using advertise addresses"

Ps. I consider acceptable this solution based on parsing manifests only because this is something that should go away the next release

Copy link
Member

Choose a reason for hiding this comment

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

ok, understood. etcdPod is also not used for the err != nil case, so this should be fine.
/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 22, 2018
@AishSundar
Copy link
Contributor

/cc @dougm

we want this in Beta.2 @dougm

@k8s-ci-robot k8s-ci-robot merged commit d7823be into kubernetes:master Nov 22, 2018
@fabriziopandini fabriziopandini deleted the fix-etcd-connection branch December 15, 2018 08:22
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-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/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.

None yet

4 participants