worker added but not present in kubectl get nodes

1/21/2016

I'm setting up a 2-node Kubernetes system, following the Docker Multi-Node instructions.

My problem is that kubectl get nodes only shows the master, not the worker node as well.

  • The setup appears to have worked, with all the expected containers running (as far as I know)
  • I've confirmed that networking works via flannel.
  • The subnet of the work node appears in the master's subnet list.

So everything looks good, except the node isn't showing up.

My questions:

  1. Am I right in thinking the worker node should now be visible from 'get nodes'?

  2. Does it matter whether the MASTER_IP used to do the setup was the master node's public IP address, or the docker IP? (I've tried both..)

  3. Where do I start with debugging this?

Any pointers gratefully accepted...

Versions:

  • Ubuntu Trusty 14.04 LTS on both master and worker
  • Kubernetes v1.1.4
  • hyperkube:v1.0.3
-- Rachel
kubernetes

1 Answer

1/22/2016

Answering my own #cloudplatform question...

It turned out to be a problem in worker.sh in Kubernetes v1.1.4.

kubectl is called with "--hostname-override=$(hostname -i)"

On this machine, that returns the IPv6 address.

The K8s code is trying to turn that into a DNS name, and fails.

So looking at the log file for the kubectl container, we see this:

I0122 15:57:33.891577    1786 kubelet.go:1942] Recording NodeReady event message for node 2001:41c9:1:41f::131
I0122 15:57:33.891599    1786 kubelet.go:790] Attempting to register node 2001:41c9:1:41f::131
I0122 15:57:33.894076    1786 kubelet.go:793] Unable to register 2001:41c9:1:41f::131 with the apiserver: Node "2001:41c9:1:41f::131" is invalid: [metadata.name: invalid value '2001:41c9:1:41f::131': must be a DNS subdomain (at most 253 characters, matching regex [a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*): e.g. "example.com", metadata.labels: invalid value '2001:41c9:1:41f::131': must have at most 63 characters, matching regex (([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?: e.g. "MyValue" or ""]

So that's my problem. Take that out and it all works well.

So in answer to my 3 questions:

  1. Yes, the worker node should be visible immediately in 'get nodes'.
  2. I don't think it matters for getting it to work; it may matter for security reasons.
  3. First step after checking that the basic networking is right and the containers are running: look at the log file for the new node's kubectl container.

Update: I wrote this blog post to explain how I got it working http://blog.willmer.org/2016/11/kubernetes-bytemark/

-- Rachel
Source: StackOverflow