Welcome to the Linux Foundation Forum!

Lab 16.2 > kubectl on master node not working properly after setting k8smaster to haproxy IP

jlagerpusch
jlagerpusch Posts: 2
edited July 2020 in LFS258 Class Forum

In Lab 16.2 after step 4 (editing the hosts file on master to change the alias for k8smaster to point to the haproxy IP instead of the internal master IP), the command in step 6 kubectl get nodes does only respond or after a timeout.

kubectl cluster-info gives me this:

student@master:~$ kubectl cluster-info 

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
Error from server (InternalError): an error on the server ("") has prevented the request from succeeding 

However, kubectl cluster-info dumpcomes back with the same error...

When I change the entry in the hosts file back to the masters' internal IP, it's working again.

HAproxy seems to be properly set up, as I can see the entries shown in the screenshot of step 5 - however, the first entry under "k8sServers" showing the master node is marked as DOWN... (LastChk says "Layer 4 Timeout in 2002ms")

Any idea where to look for solving this?

Thanks in advance,
Jan

Comments

  • jlagerpusch
    jlagerpusch Posts: 2
    edited July 2020

    I found the problem... haproxy.cfg was missing a "1" at 1 part of the master IP :s

    An admin might delete this thread... Sorry for bothering...

  • serewicz
    serewicz Posts: 1,000

    No worries. Typos happen :-) I think it helps others consider double-checking what they typed. I make these kind of mistakes myself. A lot.

    Regards,

  • I had this problem too. The resolution was to realize that the "bind" statements for the frontend declaration in the haproxy config need to include the port 6443 which the cluster listens to, else the proxy cannot connect to the cluster. (I had 443 originally)...

  • Hi @BenDorman,

    If you examine closely Step 2 in Exercise 16.2, the suggested edits to the haproxy.cfg file include port 6443. The same edits are also found in the file with the same name included in the SOLUTIONS tarball.

    Regards,
    -Chris

Categories

Upcoming Training