Kubernetes pods pending, nodes not registered

Hi guys,

I’m having an issue with running k8s with Rancher. Here’s what’s going on: I am deploying everything on Azure with Terraform and am later on provisioning the Rancher server with simple script that creates k8s environment. Once that’s done, terraform continues by creating 3 Azure VMs and then is running simple provisioning script that starts Rancher agent and it registers them with the server via registration URL and token.

And that seems to work as I am able to see these hosts registered via Rancher UI, I can see the environment bien properly created and these hosts being added to that env, with k8s services running on them. Everything’s green and it seems to be working.

But when I start k8s cli via Rancher and run commands in order to show pods and nodes, I am seeing no nodes and all pods (kube-system namespace) seems to be in a ‘pending’ state.

I’ve been reading on how others were dealing with the similar issues and once I’ve tried out all options, I’m still where I left of. I have ensured that all k8s hosts are having different hostnames, I’m starting the agent’s container with CATTLE_AGENT_IP="${rancher_agent_private_ip}", but nothing helps.

What to check next?

Thanks in advance!

I’m running the latest version of both Rancher Server (v1.6.13) and Agent(v1.2.8). Docker version is 17.09.0-ce.

I’ve switched over to installing 17.03.x-ce since this page suggests that this version is supported by the Rancher Server version I’m using. And that it supports k8s as well. Unfortunately nothing has changed as I’m still experiencing the same.

If you see no nodes, you might be hitting the limit of characters in a hostname. You can check the kubelet container log to see why it cannot register.