2

Question

How can I enable HTTP requests? I have a primary web server that is a proxy and sends HTTP requests to the MicroK8S server but cannot due to the HTTP error.

Install command used:

sudo snap install microk8s --classic --channel=1.23/stable

Infrastructure

Self-Hosted on a virtual machine locally

Problem

I have a MicroK8S server setup using this command: microk8s enable dashboard dns registry istio

I have also edited the dashboard service as such (replaced clusterip with nodeport)

kubernetes-dashboard service

enter image description here

enter image description here

Result

I can navigate to the kubernetes-dashboard by going to https://IP:30051/ of the server (yes, requests using SSL work). However if I try to use HTTP instead of HTTPS I get the following error message.

Client sent an HTTP request to an HTTPS server.

Pie
  • 292
  • 1
  • 5
  • 17
  • Please provide more information about your current setup - which Kubernetes version are you using, which solution did you use to setup a cluster (kubeadm or some cloud provider solution etc.). – Bazhikov Jan 06 '22 at 21:00
  • @Bazhikov provided the requested updates. However, the process for allowing HTTP for the dashboard I imagine would be the same regardless of version. – Pie Jan 07 '22 at 02:27

1 Answers1

0

Answered in Slack, the default addon doesn't pass --insecure-bind-address so the insecure port is accessible only on localhost: https://github.com/kubernetes/kubernetes/blob/b5103f61175a10d6b066eeb3ef603263f9b61bd4/cluster/addons/dashboard/dashboard.yaml#L195-L196

You can find all options documented here: https://github.com/kubernetes/dashboard/blob/1148f7ba9f9eadd719e53fa3bc8bde5b7cfdb395/docs/common/dashboard-arguments.md#arguments

If you add --insecure-bind-address=0.0.0.0 to the CLI options and switch your service to port 9090 then you can use HTTP instead.

But also just don't do this, it's a bad and unsafe idea.

coderanger
  • 836
  • 4
  • 13
  • There is a login-not-available error when using HTTP. How do I get around this? https://github.com/kubernetes/dashboard/blob/master/docs/user/accessing-dashboard/README.md#login-not-available – Pie Jan 13 '22 at 22:34