Score:0

Rancher on k8s gives 404 page not found

cn flag

I installed a kubernetes cluster with k3sup on a VM on my local hypervisor and the pods are up and running. Now I wanted to add a deployment with rancher in its latest version (2.6) to manage another cluster according to this guide. But the DNS and IP return a 404 not found.

Here are some terminal commands with results that might help.

$kubectl -n cattle-system get deploy rancher
NAME      READY   UP-TO-DATE   AVAILABLE   AGE
rancher   3/3     3            3           5d3h

$kubectl get pods -n cattle-system -o wide
NAME                               READY   STATUS    RESTARTS   AGE     IP           NODE          NOMINATED NODE   READINESS GATES
rancher-webhook-7f84b74ddb-44449   1/1     Running   1          5d20h   10.42.0.44   k8s-rancher   <none>           <none>
rancher-87d4dc99d-94hqb            1/1     Running   20         5d20h   10.42.0.42   k8s-rancher   <none>           <none>
rancher-87d4dc99d-b5fm2            1/1     Running   17         5d20h   10.42.0.45   k8s-rancher   <none>           <none>
rancher-87d4dc99d-dxmfl            1/1     Running   17         5d20h   10.42.0.41   k8s-rancher   <none>           <none>

The many restarts come from the missing connection to the websocket, I think.

$kubectl -n cattle-system logs rancher-87d4dc99d-94hqb
... [repeating the connection failure on all 3 pods]
2021/10/04 23:29:13 [ERROR] Failed to connect to peer wss://10.42.0.45/v3/connect [local ID=10.42.0.42]: dial tcp 10.42.0.45:443: connect: no route to host

In the container I can not reach the IP of another server.

$kubectl exec --stdin -n cattle-system --tty rancher-87d4dc99d-94hqb -- /bin/bash
[in the container]$ curl 10.42.0.45
curl: (7) Failed to connect to 10.42.0.45 port 80: No route to host

What can I do to get it working? Thanks in advance for the help.

in flag
With that amount of troubleshooting detail, I'm not sure what value you are expecting the Internet to offer you. What is 10.42.0.45? Can everything except your sekrit pod named `xxxx1` reach it? Can your Node? Do you have CNI running successfully? Are the **20** restarts indicative of cluster starvation? Good luck with your question
matt_j avatar
in flag
Could you please answer mdaniel's questions? What version of Rancher do you have ? Can you use the commands/steps listed on [this page](https://rancher.com/docs/rancher/v2.5/en/troubleshooting/networking/) to check networking related issues in your cluster ?
Wytrzymały Wiktor avatar
it flag
Hello @RUFmord. Any updates?
RUFmord avatar
cn flag
Thank you for your help. You asked the right questions that helped me solve it. The first problem was, that I forgot to open some ports in the firewalls of the machines. So I did that, it solved the connection errors. The second thing was, that I entered the domain name of the rancher server, which gave me 404. If typing the FQDN it works.
Score:0
in flag

As the problem has already been resolved in the comments section, I decided to provide a Community Wiki answer just for better visibility to other community members.

The commands/steps listed on this page are really useful for checking network related issues in the cluster.

First, I recommend checking that all the required ports are open in your (host) firewall as described here.

Wytrzymały Wiktor avatar
it flag
Hello @RUFmord. Consider [accepting the answer](https://stackoverflow.com/help/accepted-answer) if it solves your issue.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.