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

Kubelet disregards "hostname-override" if cloud-provider=aws is set #64659

Closed
trondhindenes opened this issue Jun 2, 2018 · 4 comments
Closed
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@trondhindenes
Copy link

trondhindenes commented Jun 2, 2018

/kind bug

What happened:
Given a kubelet configured with --cloud-provider=aws, --hostname-override=ldm-0110069 and --register-node=true, the kubelet still tries to register with the api server as the "aws-specified" hostname (for example ip-something.eu-west-1.compute.internal). This is problematic for custom provisioners if the configured node cert doesn't include the "aws-format" node name, as kube-apiserver won't allow the node to register. In general there's very little information in the docs about what the "cloud-provider" flag actually does, but IMHO it's pretty clear that the "hostname-override" flag should "win" (especially since that flag is explicitly documented while the cloud-provider flag isnt).

What you expected to happen:
Kubelet should register with the configured value of --hostname-override.

How to reproduce it (as minimally and precisely as possible):
Configure a kubelet on an aws instance with the flags listed above. In order to verify that this indeed caused by the cloud-provider flag, remove that flag from the kublet parameter and restart the kubelet service/pod. The kubelet is now able to register to the api with the name specified in hostname-override

Anything else we need to know?:

Environment:

  • Kubernetes version (use kubectl version): 1.10.2
  • Cloud provider or hardware configuration: aws
  • OS (e.g. from /etc/os-release): ubuntu 16.04
  • Kernel (e.g. uname -a):
  • Install tools: custom
  • Others:
@k8s-ci-robot k8s-ci-robot added needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. kind/bug Categorizes issue or PR as related to a bug. labels Jun 2, 2018
@trondhindenes
Copy link
Author

/sig aws

@k8s-ci-robot k8s-ci-robot added sig/aws and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jun 2, 2018
@liggitt
Copy link
Member

liggitt commented Jun 2, 2018

/close

duplicate of #54482

when using --cloud-provider, the cloud provider is authoritative on the node name and addresses

that cannot be overridden via a kubelet flag, or the other components (apiserver, controller manager, etc) would have no trustworthy way of know what node name corresponded to a particular AWS instance.

See work in progress to allow labeling AWS instances with the desired node name in #61878

@trondhindenes
Copy link
Author

Thanks. I still think the cloud-provider flag could have been documented better, it's next to impossible to figure out what it actually does (and doesn't). Thanks for replying anyway.

@liggitt
Copy link
Member

liggitt commented Jun 2, 2018

I still think the cloud-provider flag could have been documented better, it's next to impossible to figure out what it actually does (and doesn't).

That's fair. Opened #64661 and kubernetes/website#8873 as a start

mgdevstack pushed a commit to mgdevstack/kubernetes that referenced this issue Jun 4, 2018
Automatic merge from submit-queue (batch tested with PRs 63453, 64592, 64482, 64618, 64661). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Clarify --hostname-override and --cloud-provider interaction

pairs with a PR to the website cloud provider page defining behavior for existing cloud providers: kubernetes/website#8873

xref kubernetes#64659 kubernetes#62600 kubernetes#61774 kubernetes#54482

```release-note
NONE
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants