<p>I'm trying to configure Kubernetes Dashboard using NGINX INGRESS but for some reason I'm getting a 503 error.</p>
<p>I'm running Kubernetes locally in my macbook with docker desktop.</p>
<p>First thing I did was apply/install NGINX INGRESS CONTROLLER</p>
<pre><code>kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.47.0/deploy/static/provider/cloud/deploy.yaml
</code></pre>
<p>Second step was to apply/install kubernetes dashboard YML File</p>
<pre><code>kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.2.0/aio/deploy/recommended.yaml
</code></pre>
<p>Third Step was to apply the ingress service</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: dashboard-ingress
  namespace: kubernetes-dashboard
  annotations:
    nginx.ingress.kubernetes.io/backend-protocol: &quot;HTTPS&quot;
    nginx.ingress.kubernetes.io/ssl-passthrough: &quot;true&quot;
    kubernetes.io/ingress.class: &quot;nginx&quot;
    nginx.ingress.kubernetes.io/configuration-snippet: |-
      proxy_ssl_server_name on;
      proxy_ssl_name $host;
spec:
  rules:
    - http:
        paths:
          - pathType: Prefix
            path: /
            backend:
              service:
                name: kubernetes-dashboard
                port:
                  number: 433
</code></pre>
<p>When I try to access http://localhost and/or https://localhost I get a 503 Service Temporarily Unavailable Error from nginx</p>
<p>Not sure what I'm doing wrong.</p>
<p>Here is part of the log from the NGINX POD</p>
<pre><code>I0630 23:36:42.049398      10 main.go:112] &quot;successfully validated configuration, accepting&quot; ingress=&quot;dashboard-ingress/kubernetes-dashboard&quot;
I0630 23:36:42.055306      10 event.go:282] Event(v1.ObjectReference{Kind:&quot;Ingress&quot;, Namespace:&quot;kubernetes-dashboard&quot;, Name:&quot;dashboard-ingress&quot;, UID:&quot;85e7bd9e-308d-4848-8b70-4a3591415464&quot;, APIVersion:&quot;networking.k8s.io/v1beta1&quot;, ResourceVersion:&quot;47868&quot;, FieldPath:&quot;&quot;}): type: 'Normal' reason: 'Sync' Scheduled for sync
I0630 23:36:42.056435      10 controller.go:146] &quot;Configuration changes detected, backend reload required&quot;
I0630 23:36:42.124850      10 controller.go:163] &quot;Backend successfully reloaded&quot;
I0630 23:36:42.125333      10 event.go:282] Event(v1.ObjectReference{Kind:&quot;Pod&quot;, Namespace:&quot;ingress-nginx&quot;, Name:&quot;ingress-nginx-controller-5b74bc9868-gplcq&quot;, UID:&quot;bbd70716-b843-403b-a8f9-2add0f63f63f&quot;, APIVersion:&quot;v1&quot;, ResourceVersion:&quot;46315&quot;, FieldPath:&quot;&quot;}): type: 'Normal' reason: 'RELOAD' NGINX reload triggered due to a change in configuration
192.168.65.3 - - [30/Jun/2021:23:36:44 +0000] &quot;GET / HTTP/1.1&quot; 400 54 &quot;-&quot; &quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36&quot; 657 0.003 [kubernetes-dashboard-kubernetes-dashboard-80] [] 10.1.0.25:8443 48 0.002 400 395aec46af3b21e79cd650f2f86722f3
2021/06/30 23:36:44 [error] 1222#1222: *17477 recv() failed (104: Connection reset by peer) while sending to client, client: 192.168.65.3, server: _, request: &quot;GET / HTTP/1.1&quot;, upstream: &quot;http://10.1.0.25:8443/&quot;, host: &quot;localhost&quot;
2021/06/30 23:36:45 [error] 1222#1222: *17512 recv() failed (104: Connection reset by peer) while sending to client, client: 192.168.65.3, server: _, request: &quot;GET / HTTP/1.1&quot;, upstream: &quot;http://10.1.0.25:8443/&quot;, host: &quot;localhost&quot;
192.168.65.3 - - [30/Jun/2021:23:36:45 +0000] &quot;GET / HTTP/1.1&quot; 400 54 &quot;-&quot; &quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36&quot; 657 0.002 [kubernetes-dashboard-kubernetes-dashboard-80] [] 10.1.0.25:8443 48 0.001 400 a15e1e48987948cb93503b494d188654
2021/07/01 00:09:31 [error] 1224#1224: *49299 recv() failed (104: Connection reset by peer) while reading upstream, client: 192.168.65.3, server: _, request: &quot;GET / HTTP/1.1&quot;, upstream: &quot;http://10.1.0.25:8443/&quot;, host: &quot;localhost&quot;
192.168.65.3 - - [01/Jul/2021:00:09:31 +0000] &quot;GET / HTTP/1.1&quot; 400 54 &quot;-&quot; &quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36&quot; 657 0.002 [kubernetes-dashboard-kubernetes-dashboard-80] [] 10.1.0.25:8443 48 0.001 400 ac6b88ca52b73358c39371cb4422761d
2021/07/01 00:09:32 [error] 1221#1221: *49336 recv() failed (104: Connection reset by peer) while sending to client, client: 192.168.65.3, server: _, request: &quot;GET / HTTP/1.1&quot;, upstream: &quot;http://10.1.0.25:8443/&quot;, host: &quot;localhost&quot;
192.168.65.3 - - [01/Jul/2021:00:09:32 +0000] &quot;GET / HTTP/1.1&quot; 400 54 &quot;-&quot; &quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36&quot; 657 0.001 [kubernetes-dashboard-kubernetes-dashboard-80] [] 10.1.0.25:8443 48 0.001 400 2c5cd2d9403a8e50a77fdc897c694792
2021/07/01 00:09:33 [error] 1221#1221: *49338 recv() failed (104: Connection reset by peer) while sending to client, client: 192.168.65.3, server: _, request: &quot;GET / HTTP/1.1&quot;, upstream: &quot;http://10.1.0.25:8443/&quot;, host: &quot;localhost&quot;
192.168.65.3 - - [01/Jul/2021:00:09:33 +0000] &quot;GET / HTTP/1.1&quot; 400 54 &quot;-&quot; &quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36&quot; 657 0.001 [kubernetes-dashboard-kubernetes-dashboard-80] [] 10.1.0.25:8443 48 0.000 400 f1f630c886d20b9b9c59bd9e0e0e3860
2021/07/01 00:09:33 [error] 1224#1224: *49344 recv() failed (104: Connection reset by peer) while reading upstream, client: 192.168.65.3, server: _, request: &quot;GET / HTTP/1.1&quot;, upstream: &quot;http://10.1.0.25:8443/&quot;, host: &quot;localhost&quot;
192.168.65.3 - - [01/Jul/2021:00:09:33 +0000] &quot;GET / HTTP/1.1&quot; 400 54 &quot;-&quot; &quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36&quot; 657 0.001 [kubernetes-dashboard-kubernetes-dashboard-80] [] 10.1.0.25:8443 48 0.001 400 2ab6774dec6e2a89599c4745d24b9661
192.168.65.3 - - [01/Jul/2021:00:09:33 +0000] &quot;GET / HTTP/1.1&quot; 400 54 &quot;-&quot; &quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36&quot; 657 0.001 [kubernetes-dashboard-kubernetes-dashboard-80] [] 10.1.0.25:8443 48 0.000 400 c9147e08203d9ec8e7b0d0debab8d556
2021/07/01 00:09:33 [error] 1222#1222: *49360 recv() failed (104: Connection reset by peer) while sending to client, client: 192.168.65.3, server: _, request: &quot;GET / HTTP/1.1&quot;, upstream: &quot;http://10.1.0.25:8443/&quot;, host: &quot;localhost&quot;
I0701 00:10:19.024220      10 main.go:112] &quot;successfully validated configuration, accepting&quot; ingress=&quot;dashboard-ingress/kubernetes-dashboard&quot;
I0701 00:10:19.026772      10 controller.go:146] &quot;Configuration changes detected, backend reload required&quot;
I0701 00:10:19.027392      10 event.go:282] Event(v1.ObjectReference{Kind:&quot;Ingress&quot;, Namespace:&quot;kubernetes-dashboard&quot;, Name:&quot;dashboard-ingress&quot;, UID:&quot;85e7bd9e-308d-4848-8b70-4a3591415464&quot;, APIVersion:&quot;networking.k8s.io/v1beta1&quot;, ResourceVersion:&quot;50637&quot;, FieldPath:&quot;&quot;}): type: 'Normal' reason: 'Sync' Scheduled for sync
I0701 00:10:19.102759      10 controller.go:163] &quot;Backend successfully reloaded&quot;
I0701 00:10:19.103246      10 event.go:282] Event(v1.ObjectReference{Kind:&quot;Pod&quot;, Namespace:&quot;ingress-nginx&quot;, Name:&quot;ingress-nginx-controller-5b74bc9868-gplcq&quot;, UID:&quot;bbd70716-b843-403b-a8f9-2add0f63f63f&quot;, APIVersion:&quot;v1&quot;, ResourceVersion:&quot;46315&quot;, FieldPath:&quot;&quot;}): type: 'Normal' reason: 'RELOAD' NGINX reload triggered due to a change in configuration
192.168.65.3 - - [01/Jul/2021:00:11:27 +0000] &quot;GET / HTTP/1.1&quot; 503 592 &quot;-&quot; &quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36&quot; 657 0.000 [kubernetes-dashboard-kubernetes-dashboard-433] [] - - - - c449f6e8082761ddc3432f956f4701f2
192.168.65.3 - - [01/Jul/2021:00:11:29 +0000] &quot;GET / HTTP/1.1&quot; 503 592 &quot;-&quot; &quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36&quot; 657 0.000 [kubernetes-dashboard-kubernetes-dashboard-433] [] - - - - 3a41974b01c5e63e734fce6e37b98e4c
192.168.65.3 - - [01/Jul/2021:00:11:56 +0000] &quot;GET / HTTP/2.0&quot; 503 592 &quot;-&quot; &quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36&quot; 408 0.000 [kubernetes-dashboard-kubernetes-dashboard-433] [] - - - - c01f7bec83d3be6b26703b8808f9922a
192.168.65.3 - - [01/Jul/2021:00:11:58 +0000] &quot;GET / HTTP/2.0&quot; 503 592 &quot;-&quot; &quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36&quot; 24 0.000 [kubernetes-dashboard-kubernetes-dashboard-433] [] - - - - dc39bcddd4ecfdefe931bf16fe3c1557
192.168.65.3 - - [01/Jul/2021:00:16:36 +0000] &quot;GET / HTTP/1.1&quot; 503 190 &quot;-&quot; &quot;curl/7.64.1&quot; 73 0.000 [kubernetes-dashboard-kubernetes-dashboard-433] [] - - - - 82aad4321afbccb3fc54ac75d96b66ee
192.168.65.3 - - [01/Jul/2021:00:31:47 +0000] &quot;GET / HTTP/2.0&quot; 503 592 &quot;-&quot; &quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36&quot; 417 0.000 [kubernetes-dashboard-kubernetes-dashboard-433] [] - - - - c4ab3d2f272be4d38df62c0ffd50bfe9
I0701 00:48:02.059067      10 main.go:112] &quot;successfully validated configuration, accepting&quot; ingress=&quot;dashboard-ingress/kubernetes-dashboard&quot;
I0701 00:48:02.062292      10 event.go:282] Event(v1.ObjectReference{Kind:&quot;Ingress&quot;, Namespace:&quot;kubernetes-dashboard&quot;, Name:&quot;dashboard-ingress&quot;, UID:&quot;85e7bd9e-308d-4848-8b70-4a3591415464&quot;, APIVersion:&quot;networking.k8s.io/v1beta1&quot;, ResourceVersion:&quot;53737&quot;, FieldPath:&quot;&quot;}): type: 'Normal' reason: 'Sync' Scheduled for sync
I0701 00:48:02.062876      10 controller.go:146] &quot;Configuration changes detected, backend reload required&quot;
I0701 00:48:02.131494      10 controller.go:163] &quot;Backend successfully reloaded&quot;
I0701 00:48:02.131787      10 event.go:282] Event(v1.ObjectReference{Kind:&quot;Pod&quot;, Namespace:&quot;ingress-nginx&quot;, Name:&quot;ingress-nginx-controller-5b74bc9868-gplcq&quot;, UID:&quot;bbd70716-b843-403b-a8f9-2add0f63f63f&quot;, APIVersion:&quot;v1&quot;, ResourceVersion:&quot;46315&quot;, FieldPath:&quot;&quot;}): type: 'Normal' reason: 'RELOAD' NGINX reload triggered due to a change in configuration
192.168.65.3 - - [01/Jul/2021:00:48:12 +0000] &quot;GET / HTTP/2.0&quot; 503 592 &quot;-&quot; &quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36&quot; 417 0.000 [kubernetes-dashboard-kubernetes-dashboard-433] [] - - - - d50e3bb0db3a5fa7581c405b8c50d5c8
192.168.65.3 - - [01/Jul/2021:00:48:14 +0000] &quot;GET / HTTP/2.0&quot; 503 592 &quot;-&quot; &quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36&quot; 15 0.000 [kubernetes-dashboard-kubernetes-dashboard-433] [] - - - - c8d8752fb4d79d5bc084839ef9a767b2
I0701 00:49:50.908720      10 main.go:112] &quot;successfully validated configuration, accepting&quot; ingress=&quot;dashboard-ingress/kubernetes-dashboard&quot;
I0701 00:49:50.911044      10 controller.go:146] &quot;Configuration changes detected, backend reload required&quot;
I0701 00:49:50.911350      10 event.go:282] Event(v1.ObjectReference{Kind:&quot;Ingress&quot;, Namespace:&quot;kubernetes-dashboard&quot;, Name:&quot;dashboard-ingress&quot;, UID:&quot;85e7bd9e-308d-4848-8b70-4a3591415464&quot;, APIVersion:&quot;networking.k8s.io/v1beta1&quot;, ResourceVersion:&quot;53896&quot;, FieldPath:&quot;&quot;}): type: 'Normal' reason: 'Sync' Scheduled for sync
I0701 00:49:50.979935      10 controller.go:163] &quot;Backend successfully reloaded&quot;
I0701 00:49:50.980213      10 event.go:282] Event(v1.ObjectReference{Kind:&quot;Pod&quot;, Namespace:&quot;ingress-nginx&quot;, Name:&quot;ingress-nginx-controller-5b74bc9868-gplcq&quot;, UID:&quot;bbd70716-b843-403b-a8f9-2add0f63f63f&quot;, APIVersion:&quot;v1&quot;, ResourceVersion:&quot;46315&quot;, FieldPath:&quot;&quot;}): type: 'Normal' reason: 'RELOAD' NGINX reload triggered due to a change in configuration
192.168.65.3 - - [01/Jul/2021:00:50:55 +0000] &quot;GET / HTTP/2.0&quot; 503 592 &quot;-&quot; &quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36&quot; 417 0.000 [kubernetes-dashboard-kubernetes-dashboard-433] [] - - - - d62a8012bc23bbc35a47621d54d68a62
192.168.65.3 - - [01/Jul/2021:00:51:00 +0000] &quot;GET / HTTP/2.0&quot; 503 592 &quot;-&quot; &quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36&quot; 15 0.000 [kubernetes-dashboard-kubernetes-dashboard-433] [] - - - - 0cbfd2274ad687fc1aaff76dbc483659
</code></pre>
<p>Here is the log for the Kubernete Dashboard Pod</p>
<pre><code>kubectl logs kubernetes-dashboard-78c79f97b4-w5pw9 -n kubernetes-dashboard                                                                                                                                  ✔  docker-desktop ⎈
2021/06/30 23:01:40 Starting overwatch
2021/06/30 23:01:40 Using namespace: kubernetes-dashboard
2021/06/30 23:01:40 Using in-cluster config to connect to apiserver
2021/06/30 23:01:40 Using secret token for csrf signing
2021/06/30 23:01:40 Initializing csrf token from kubernetes-dashboard-csrf secret
2021/06/30 23:01:40 Empty token. Generating and storing in a secret kubernetes-dashboard-csrf
2021/06/30 23:01:40 Successful initial request to the apiserver, version: v1.21.1
2021/06/30 23:01:40 Generating JWE encryption key
2021/06/30 23:01:40 New synchronizer has been registered: kubernetes-dashboard-key-holder-kubernetes-dashboard. Starting
2021/06/30 23:01:40 Starting secret synchronizer for kubernetes-dashboard-key-holder in namespace kubernetes-dashboard
2021/06/30 23:01:41 Initializing JWE encryption key from synchronized object
2021/06/30 23:01:41 Creating in-cluster Sidecar client
2021/06/30 23:01:41 Auto-generating certificates
2021/06/30 23:01:41 Successful request to sidecar
2021/06/30 23:01:41 Successfully created certificates
2021/06/30 23:01:41 Serving securely on HTTPS port: 8443
</code></pre>
<p>Here are the endpoints for the kubernetes-dashboard namespace</p>
<pre><code>kubectl get ep -n kubernetes-dashboard                                                                                                                                                                   
NAME                        ENDPOINTS        AGE
dashboard-metrics-scraper   10.1.0.24:8000   11h
kubernetes-dashboard        10.1.0.25:8443   11h
</code></pre>
<p>Any help would be greatly appreciated.</p>

Carlos Sosa
<p>I was able to fix this issue.
In my ingress ymal file I had a typo. Port number was set to <code>433</code> instead of <code>443</code></p>
<p>As soon as I made and applied that change, I was able to access the dashboard login page with: https://localhost and http://localhost</p>
