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

Updates to always pass spec.nodeName as --hostname-override #71283

Merged
merged 1 commit into from
Nov 21, 2018

Conversation

Klaven
Copy link
Contributor

@Klaven Klaven commented Nov 20, 2018

per kubernetes/kubeadm#857 updated manifest file to always pass spec.nodeName as the --hostname-override.

What type of PR is this?

/kind bug

What this PR does / why we need it:
Fixes kubernetes/kubeadm#857

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 #kubernetes/kubeadm#857

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

-->

kubeadm: always pass spec.nodeName as --hostname-override for kube-proxy

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Nov 20, 2018
@k8s-ci-robot
Copy link
Contributor

Hi @Klaven. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. area/kubeadm sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 20, 2018
@Klaven
Copy link
Contributor Author

Klaven commented Nov 20, 2018

@detiber @neolit123 @anguslees I have made the above PR per the comments in the kubernetes/kubeadm#857 ticket. If I have understood everything correctly this was all that was needed done. pleast let me know your thoughts.

@neolit123
Copy link
Member

/priority critical-urgent
/ok-to-test

@k8s-ci-robot k8s-ci-robot added priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Nov 20, 2018
@Klaven
Copy link
Contributor Author

Klaven commented Nov 20, 2018

I kind of wanted to write some type of test for this... but was not quite sure what would be best/useful. if you all have any suggestions I would love to hear it!

@nikopen
Copy link
Contributor

nikopen commented Nov 20, 2018

/milestone v1.13
/kind bug

@k8s-ci-robot k8s-ci-robot added this to the v1.13 milestone Nov 20, 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 this PR @Klaven
added a comment about YAML nesting.

cmd/kubeadm/app/phases/addons/proxy/manifests.go Outdated Show resolved Hide resolved
@Klaven
Copy link
Contributor Author

Klaven commented Nov 20, 2018

/retest pull-kubernetes-integration

@@ -80,6 +80,7 @@ spec:
command:
- /usr/local/bin/kube-proxy
- --config=/var/lib/kube-proxy/{{ .ProxyConfigMapKey }}
- --hostname-override=$NODE_NAME
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 the syntax needs to be $(NODE_NAME) (with the parens) to be substituted by kubelet. Otherwise it's asking a shell somewhere down the line to do the substitution - and I don't think there's a shell involved in this specific example. Indeed, if it does also work as you've written, then I'm kind of alarmed, since I think that means the image entrypoint(?) is re-evaluating its arguments and hence introducing a bunch of shell escaping / word-splitting bugs.

My test, just to confirm I wasn't crazy (on my local k8s 1.9 cluster):

apiVersion: v1
kind: Pod
metadata:
  name: test-pod
spec:
  containers:
    - name: test
      image: busybox
      command:
        - echo
        - A=$FOO
        - B=$(FOO)
        - C=${FOO}
      env:
        - name: FOO
          value: foo

=>

A=$FOO B=foo C=${FOO}

Copy link
Contributor Author

@Klaven Klaven Nov 20, 2018

Choose a reason for hiding this comment

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

mine was substituted. aka A == foo . @neolit123 and I did talk about what the proper syntax was prior to this. But I can update. running a build and will build a cluster with the (...)

Copy link
Member

Choose a reason for hiding this comment

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

thanks @anguslees
i suggested the variable without ( ), but wasn't 100% sure about it.

@Klaven mentioned that this works in his tests, but we should probably use ( ... ).

Indeed, if it does also work as you've written, then I'm kind of alarmed, since I think that means the image entrypoint(?) is re-evaluating its arguments and hence introducing a bunch of shell escaping / word-splitting bugs.

yes this is puzzling. i'd suggest what we just get it right under command, as it's unlikely we will have time to investigate further. too many items to look for 1.13.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, @anguslees before I destroyed the old cluster I checked again. --hostname-override != $NODE_NAME as this would imply. building new cluster now. I'm good with putting the (...) in if it works the same. will update you when i'm finished testing.

Copy link
Contributor Author

@Klaven Klaven Nov 20, 2018

Choose a reason for hiding this comment

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

by the way, do you have a good way of automated testing of this bug? I wanted too.... but ran out of time.

Copy link
Member

Choose a reason for hiding this comment

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

IMO, integration or e2e for this are out of scope for this PR.

Copy link
Member

Choose a reason for hiding this comment

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

yep, e2e is out of scope imo.

It's clear that there is nowhere (or not much) in the current e2e tests that exercises hostname != node name, since there are frequent bugs around this. It would be great to change the hostnames/node-names for all the e2e tests, but that's quite separate to this PR.

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.

/approve

@timothysc
Copy link
Member

/test pull-kubernetes-integration
/test pull-kubernetes-e2e-kops-aws

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Klaven, 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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 20, 2018
updated manifest file to always pass spec.nodeName as the --hostname-override.
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
thanks to @Klaven and @anguslees for hinting surrounding issues for this.

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

@anguslees anguslees left a comment

Choose a reason for hiding this comment

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

/lgtm

@@ -80,6 +80,7 @@ spec:
command:
- /usr/local/bin/kube-proxy
- --config=/var/lib/kube-proxy/{{ .ProxyConfigMapKey }}
- --hostname-override=$NODE_NAME
Copy link
Member

Choose a reason for hiding this comment

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

yep, e2e is out of scope imo.

It's clear that there is nowhere (or not much) in the current e2e tests that exercises hostname != node name, since there are frequent bugs around this. It would be great to change the hostnames/node-names for all the e2e tests, but that's quite separate to this PR.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Nov 20, 2018
@k8s-ci-robot k8s-ci-robot merged commit 1431aeb into kubernetes:master Nov 21, 2018
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kube-proxy needs to be configured to override hostname in some environments
6 participants