1

We have some vmware virtual machines with RHEL 7.6 installed, recently all of them got a reboot due data center move location.

The problem is, after reboot some applicaiton, such as Java, kube-proxy only listen on tcp6 sockets, which is strange. Even I restart those applications, they still only listen on tcp6 sockets, I need to add jvm arguments java.net.preferIPv4Stack=true to let it listen on ipv4 sockets again. but for kube-proxy(kubernetes cluster proxy), I don't found a solution.

I saw people says, tcp6 imply tcp, however, I can't access those sockets with ipv4 address.

my question is: what may cause this ? I don't want to disable ipv6, but just prefer ipv4.

[root@ocrpoc1 ~]# telnet 127.0.0.1 32414
Trying 127.0.0.1...
^C
[root@ocrpoc1 ~]# telnet 127.0.0.1 6443
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
^ZConnection closed by foreign host.
[root@ocrpoc1 ~]# netstat -apn | grep kube-proxy
tcp        0      0 127.0.0.1:10249         0.0.0.0:*               LISTEN      5282/kube-proxy     
tcp        0      0 X.X.X.X:60458      X.X.X.X:6443       ESTABLISHED 5282/kube-proxy     
tcp6       0      0 :::10256                :::*                    LISTEN      5282/kube-proxy     
tcp6       0      0 :::32414                :::*                    LISTEN      5282/kube-proxy

[root@ocrpoc1 ~]# nc -4 -lk 32414
Ncat: bind to 0.0.0.0:32414: Address already in use. QUITTING.
[root@ocrpoc1 ~]# nc -6 -lk 32414
Ncat: bind to :::32414: Address already in use. QUITTING.
2
  • This does not affect all services on that system? There are services left which you can reach via IPv4? Apr 23, 2020 at 18:12
  • of course, sshd for example, I ssh to server using ipv4 address.
    – WestFarmer
    Apr 24, 2020 at 0:53

1 Answer 1

1

In case to help other people may encounter this problem.

it's caused by calico. by default, calico choose IPv4 address using "autodetect" method, which means "first-found" interface with valid ipv4 address.

one node of my kubernetes cluster have created some docker container by docker-compose, which brings bridge interfaces br-XXXXX, calico-node container choose it when starting up.

to fix this, I have edit the calico-node DaemonSet add following env variable:

name: IP_AUTODETECTION_METHOD value: can-reach=my kubernetes master node ip

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .