How to fix 404?

Hi everyone,

today I tried to set up k3s with rancher on my own bare metal server.
I followed this tutorial: Rancher Docs: Install/Upgrade Rancher on a Kubernetes Cluster
In addition to that, I have installed the nginx-ingress-controller and I have created a load balancer resource.

cattle-system  service/rancher ClusterIP 10.43.252.143 <none> 80/TCP,443/TCP               
ingress-nginx service/ingress-nginx-controller-loadbalancer LoadBalancer   10.43.169.207   167.235.229.115   80:31905/TCP,443:31332/TCP

I confirmed that everything is working by creating a simple webserver-deployment and I could reach it via my configured domain.

Now I tried to install rancher and the installation went fine, but I can’t reach the dashboard (via rancher.mydomain.eu) as I’m getting a 404 error.

This is how the (helm) generated Ingress rule looks like:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    cert-manager.io/issuer: rancher
    cert-manager.io/issuer-kind: Issuer
    meta.helm.sh/release-name: rancher
    meta.helm.sh/release-namespace: cattle-system
    nginx.ingress.kubernetes.io/proxy-connect-timeout: "30"
    nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"
    nginx.ingress.kubernetes.io/proxy-send-timeout: "1800"
  labels:
    app: rancher
    app.kubernetes.io/managed-by: Helm
    chart: rancher-2.6.5
    heritage: Helm
    release: rancher
  name: rancher
  namespace: cattle-system
  resourceVersion: "3289"
  uid: 7de6d077-4a97-4df8-8051-6a47c5ea81a7
spec:
  rules:
  - host: rancher.mydomain.eu
    http:
      paths:
      - backend:
          service:
            name: rancher
            port:
              number: 80
        pathType: ImplementationSpecific
  tls:
  - hosts:
    - rancher.mydomain.eu
    secretName: tls-rancher-ingress

kubectl -n cattle-system get ingress -o wide

NAME      CLASS    HOSTS                     ADDRESS   PORTS     AGE
rancher   <none>   rancher.mydomain.eu                 80, 443   24m

Hi,
can you provide the logs of rancher pods ?,
And what kind of certificate did you use ?

After installation, the example Nginx Ingress YAML is displayed in the terminal. You can observe a line with ingressClassName: nginx , which is causing the issue of getting a 404 error when accessing Rancher.
This is because, after installing Rancher, the Rancher Ingress YAML didn’t contains the entry ingressClassName: nginx .

spec:
  ingressClassName: nginx