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

New EndpointAddress.NodeName validation rules broke hack/local-up-cluster.sh #32050

Closed
ivan4th opened this issue Sep 4, 2016 · 0 comments
Closed

Comments

@ivan4th
Copy link
Contributor

ivan4th commented Sep 4, 2016

#31311 introduced a new requirement for node names to be DNS1123Labels.

In case of hack/local-up-cluster.sh, an IP address is used as node name and thus endpoints aren't created for services, e.g. kube-dns doesn't work anymore.

There are other projects that use IP addresses as node names for running simplified k8s dev environment:
https://github.com/metral/nanokube
https://github.com/sttts/kubernetes-dind-cluster
Probably there are other projects where it's convenient to have just an IP address as a node name.

Verified against dfccabe.

On affected installs, service latency e2e test hangs, see e.g. #30632 (comment)

Example (added some newlines):

vagrant@devbox:~/work/kubernetes/src/k8s.io/kubernetes (master %) $ cluster/kubectl.sh get nodes
NAME             STATUS    AGE
192.168.124.76   Ready     20m
vagrant@devbox:~/work/kubernetes/src/k8s.io/kubernetes (master %) $ cluster/kubectl.sh describe service kube-dns --namespace=kube-system
Name:                   kube-dns
Namespace:              kube-system
Labels:                 k8s-app=kube-dns
                        kubernetes.io/cluster-service=true
                        kubernetes.io/name=KubeDNS
Selector:               k8s-app=kube-dns
Type:                   ClusterIP
IP:                     10.0.0.10
Port:                   dns     53/UDP
Endpoints:              <none>
Port:                   dns-tcp 53/TCP
Endpoints:              <none>
Session Affinity:       None
No events.
vagrant@devbox:~/work/kubernetes/src/k8s.io/kubernetes (master %) $ grep my-name /tmp/kube-controller-manager.log|tail -1
E0904 21:00:41.940930    9123 endpoints_controller.go:514] Endpoints "kube-dns" is invalid: 
[subsets[0].addresses[0].nodeName: Invalid value: "192.168.124.76":
must match the regex [a-z0-9]([-a-z0-9]*[a-z0-9])? (e.g. 'my-name' or '123-abc'),
subsets[0].addresses[0].nodeName: Invalid value: "192.168.124.76":
must match the regex [a-z0-9]([-a-z0-9]*[a-z0-9])? (e.g. 'my-name' or '123-abc')]
ivan4th pushed a commit to ivan4th/kubernetes that referenced this issue Sep 4, 2016
k8s-github-robot pushed a commit that referenced this issue Sep 5, 2016
…as-node-names

Automatic merge from submit-queue

Allow IP addresses to be used as node names

Fixes #32050

In `pkg/api/validation/validation.go`, there's already `ValidateNodeName()`, so using `ValidateDNS1123Label()` was ujustified. Also, it broke service endpoints in `hack/local-up-cluster.sh` and some other software that doesn't want to do extra work to provide resolvable hostnames for the nodes of test clusters, e.g.
https://github.com/metral/nanokube
https://github.com/sttts/kubernetes-dind-cluster
And probably others.

On affected installs, service latency e2e test hangs, see e.g. #30632 (comment)

DNS1123Label suggestion is by @thockin, see [here](#30301 (comment)). I think it's wrong though for aforementioned reasons :(

PR that broke node names: #31311
smarterclayton pushed a commit to smarterclayton/kubernetes that referenced this issue Sep 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants