Debug Nginx Ingress Controller

Asking for help? Comment out what you need so we can get more information to help you!

Cluster information:

Kubernetes version:
GitVersion:“v1.23.5”
bare-metal
Installation method:
Host OS:
bento/ubuntu-18.04
CNI and version:
kube-flannel 0.3.1
CRI and version:
Docker 20.10.14

I have installed Kubernetes on bare-metal using vagrant.
I have configured MetalLB for accessing the cluster via LoadBalancer Services.
I have also installed Nginx Ingress Controller

I installed a simple nginx application
I can call this with Curl and it works.

I also have a simple tomcat application installed and configured with selfsignede certs mounted in a tls secret. And I can also access this one through the Ingress config.

Now the problem.
I have installed Kubernetes Dashboard and I would also like it to use ingress.
Deploy and Access the Kubernetes Dashboard | Kubernetes

I have configured a Service that uses MetalLB Loadbalancer and I can access the Console via this Service.

I created an other service that I will use with my ingress definition that look like this:

apiVersion: v1
kind: Service
metadata:
name: dashboard-ingress-http
namespace: kubernetes-dashboard
labels:
k8s-app: kubernetes-dashboard
spec:
ports:

  • port: 80
    targetPort: 8443
    protocol: TCP
    name: http
    selector:
    k8s-app: kubernetes-dashboard

And the Ingress looks like this:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: dashboard-ingress
namespace: kubernetes-dashboard
spec:
ingressClassName: nginx
tls:

  • hosts:
  • host: dashboard.hspo.com
    http:
    paths:
    • path: /
      pathType: Prefix
      backend:
      service:
      name: dashboard-ingress-http
      port:
      number: 80

I do not have a DNS server I just added the DNS to my host file.

When I do a Curl I get this reply

  • SSL certificate verify ok.

GET / HTTP/1.1
Host: dashboard.hspo.com
User-Agent: curl/7.58.0
Accept: /

< HTTP/1.1 400 Bad Request
< Server: nginx/1.21.6
< Date: Wed, 30 Mar 2022 18:34:25 GMT
< Transfer-Encoding: chunked
< Connection: keep-alive
<
Client sent an HTTP request to an HTTPS server.:

I can see the Ingress can see the service and the service can see certificates and the pods running the Dashboard.

I’m out of idea’s to how I can debug this so if anyone have a idea or input. Please let me know