0

I got a microk8s v1.28.14 cluster and I want to use the kubernetes-dashboard.

I enabled the dashboard via microk8s enable dashboard, dashboard pod and service are created in the 'kube-system'-namespace, curl -k https://10.152.183.43 on the service works.

Now I want to be able to externally access my dashboard. Using cloudflare for my domain with HTTPS redirection and flexible TLS settings.

apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: kubernetes-dashboard namespace: kube-system spec: rules: - host: cluster.my-domain.com http: paths: - path: / pathType: Prefix backend: service: name: kubernetes-dashboard port: number: 443 

The ingress itself looks fine:

Name: kubernetes-dashboard Labels: <none> Namespace: kube-system Address: 127.0.0.1 Ingress Class: public Default backend: <default> Rules: Host Path Backends ---- ---- -------- cluster.my-domain.com / kubernetes-dashboard:443 (10.1.206.212:8443) Annotations: <none> Events: <none> 

When now trying to access my dashboard (`curl -k https://cluster.my-domain.com'), I get the following error:

Client sent an HTTP request to an HTTPS server

Any idea how this could be solved?

1 Answer 1

0

AS per this Github issue

The error you are facing is due to the mismatch between the ingress controller and the service routing.

By default the Microk8s enable dashboard command exposes the dashboard service on port 80. You need to configure it to use HTTPS.

Once the dashboard service is exposed on HTTPS. Make sure CloudFlare settings have HTTPS everywhere. If you are using flexible TLS settings in Cloudflare verify the certificate validation is set to Full (strict)

When you set your encryption mode to Full (strict), Cloudflare does everything in Full mode but also enforces more stringent requirements for origin certificates.

After applying changes restart the pods and services to ensure the new configuration.

See this similar Article by portainer.io and Kubernetes discussion forum for more information.

1
  • Refer to this similar error stack link for more information. Commented Sep 29, 2024 at 13:36

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.