Flanneld not working in Kubernetes Multinode Example - docker

I am trying to follow this tutorial with two Vagrant instances:
http://kubernetes.io/v1.0/docs/getting-started-guides/docker-multinode.html
After setting up master and worker node I tried to connect to the service's IP of a simple nginx-service from the master. But it looks like the kube-proxy cannot find the docker-container of the worker-node.
The virtual IP of the service and the container-ip respond well on the worker-node
That made me think of a misfunction of flanneld.
Does anybody know how I could track down this error?
Any help is appreciated!
Thanks in advance
Best, Johannes
Output of Kube-Proxy container
I1016 20:53:42.829290 1 proxysocket.go:130] Accepted TCP connection from 10.0.2.15:51774 to 10.0.2.15:40197
E1016 20:53:43.829575 1 proxysocket.go:99] Dial failed: dial tcp 10.1.12.3:80: i/o timeout
E1016 20:53:45.825473 1 proxysocket.go:99] Dial failed: dial tcp 10.1.12.3:80: no route to host
E1016 20:53:48.825556 1 proxysocket.go:99] Dial failed: dial tcp 10.1.12.3:80: no route to host
E1016 20:53:51.825627 1 proxysocket.go:99] Dial failed: dial tcp 10.1.12.3:80: no route to host
E1016 20:53:51.825710 1 proxysocket.go:133] Failed to connect to balancer: failed to connect to an endpoint.

This looks like https://github.com/kubernetes/kubernetes/issues/14426. Try upgrading flannel to 0.5.3.

Related

docker swarm join connection error from other instance and local pc

I gave role like this.
env: oracle cloud.
open port: TCP 2377 , UDP TCP 7946 ,UDP 4786
Instance A : manager
Instance B : worker
Local PC : worker
init swarm mode with this cli on A
docker swarm init --advertise-addr <A's IP>
B got
Error response from daemon: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial tcp A's IP:2377: connect: no route to host"
Local PC got
Error response from daemon: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial tcp A's IP:2377: connect: connection refused"
well I have no idea what should I need to do more.
thank you in advance.
the problem was firewall setting on manager node's instance.
sudo firewall-cmd --add-port=2377/tcp --permanent
sudo firewall-cmd --reload
for me #Logan Lee solution perfectly matched.
According to the docker documentation, following ports need to manage accordingly
TCP port 2377 for cluster management communications
TCP and UDP port 7946 for communication among nodes
UDP port 4789 for overlay network traffic
Thanks #Logan Lee
Check the network connectivity between A and B, seems like they are not on the same network.

Docker Swarm: Getting connection refuse while adding worker node

I just started learning docker, I am facing below challenge, please let me know where I am doing wrong.
My use case: Set up docker swarm manager and add worker node to it.
Step1: To create docker manager, I used below command:
docker swarm init --advertise-addr <<ip_address>>
Step 2: Run below command, which gives you docker command to add worker.
docker swarm join-token worker
After running above command, I got output as:
docker swarm join --token SWMTKN-1-653srs28a6s48dqxnak9g9kic2cd1xyeowgnke53nf83710wfv-7u7u7u1vovahvn792814q2sts ip_address:2377
Step3: I logged-in to worker node and ran above docker swarm join command. But I am getting below error message.
Error response from daemon: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection er
ror: desc = "transport: Error while dialing dial tcp ip_address:2377: connect: connection refused"
This could well be a firewall issue, make sure you have port 2377, 7946 & 4789 in open state between the hosts acting as manager or worker node -
From the docs -
Open protocols and ports between the hosts The following ports must be
available.
TCP port 2377 for cluster management communications
TCP and UDP port 7946 for communication among nodes
UDP port 4789 for overlay network
traffic

Disable ipv6 for docker in Ubuntu 14.04

I have an issue with the docker daemon installed on an Ubuntu 14.04 VM. The logs reveal that ipv6 is enabled hence the docker seems to be listening on this ip address. Essentially, this effects Clair. I have made sure that ipv6 is disabled on the following recommendation here. I also disabled ipv6 in daemon.json as specified in Docker documentation. My docker version is Docker version 17.06.1-ce, build 874a737.
Docker daemon logs :
time="2018-02-20T20:33:17.736203462+01:00" level=info msg="IPv6 enabled; Adding default IPv6 external servers: [nameserver 2001:4860:4860::8888 nameserver 20 01:4860:4860::8844]"
Clair logs:
2018/02/20 20:43:51 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp [::]:6060: connect: cannot assign requested address"; Reconnecting to {[::]:6060 <nil>}
2018/02/20 20:46:14 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp [::]:6060: connect: cannot assign requested address"; Reconnecting to {[::]:6060 <nil>}
It's trying to make an IPv6 connection, but the address is wrong. [::] is IN6ADDR_ANY, not an actual address you can connect to. Provide the correct address in your config.yaml.
Did you mean to connect to localhost?
api:
# v3 grpc/RESTful API server address
addr: "[::1]:6060"

Error from server: error dialing backend: dial tcp 10.9.84.149:10250: getsockopt: connection refused

I have a kubernetes cluster with three nodes: 10.9.84.149,10.9.105.90 and 10.9.84.149. When my application tries to execute the command inside some pod:
kuebctl exec -it <podName>
it sometimes gets an error:
Error from server: error dialing backend: dial tcp 10.9.84.149:10250: getsockopt: connection refused
As far as I could see everything was fine with the cluster: all kube-system services and pods were running well. Besides, it didn't appear regularly.
Can anybody help me on this issue?
I got the same error as this below
Error from server: Get https://192.168.100.102:10250/containerLogs/default/kubia-n8nv9/kubia: dial tcp 192.168.100.102:10250: connect: no route to host
DISABLING THE FIREWALL WAS MY FIX ON ALL NODES
I figured out my worker nodes firewall was not disabled. I did instruction below to fix my problem
systemctl disable firewalld && systemctl stop firewalld
-Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1...
-Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.```
Looks like your kubelet process not running, or keep restarting.
ss -tnpl |grep 10250
LISTEN 0 128 :::10250 :::* users:(("kubelet",pid=1102,fd=21))
check kubelet process is running.
if its running see when its started.
look at /var/log/message file for any issue with node.
Make sure you don't have the firewall blocking the traffic

Docker swarm issue connection refused on manage

I have set up docker swarm, installed on 2 ubuntu boxes, one centos, turned of firewalls, selinux, iptables.
Here is the guide I used: http://devopscube.com/docker-tutorial-getting-started-with-docker-swarm/
When I try and manage the swarm, I get this:
swarm manage token://28dc122221ee60ea44f587e0a338f638
INFO[0000] Listening for HTTP addr=127.0.0.1:2375 proto=tcp
ERRO[0000] Get http://10.20.7.143:2375/v1.15/info: dial tcp 10.20.7.143:2375: connection refused
ERRO[0000] Get http://10.20.7.144:2375/v1.15/info: dial tcp 10.20.7.144:2375: connection refused
ERRO[0000] Get http://10.20.7.146:2375/v1.15/info: dial tcp 10.20.7.146:2375: connection refused
Any Ideas?
You might have missed the line about the updated swarm post. Here is the link to the post.
http://devopscube.com/how-to-setup-and-configure-docker-swarm-cluster/
It works!

Resources