401 Unauthorized Error from API Server on Default microk8s 1.19 installation

I’m using microk8s on Windows with Multipass. The VM is a latest Ubuntu 20.04 running microk8s 1.19. After I start microk8s and try to access the API server (on port 16443), I get a 401 error back. I’m pretty sure it used to work before but I can’t figure out how to get it working again. I’m not using any proxy yet as I believe the API server should be accessible directly. Here is the command and output. Please let me know if I’m missing any steps or making any mistakes.

ubuntu@powerful-lionfish:~$ curl --insecure https://172.18.250.3:16443/
{
“kind”: “Status”,
“apiVersion”: “v1”,
“metadata”: {

},
“status”: “Failure”,
“message”: “Unauthorized”,
“reason”: “Unauthorized”,
“code”: 401

Let me confirm, you are trying to access the apiserver using curl? Any particular reason why not use the kubectl?

Hi, yes I am trying to access the apiserver using curl, but mainly to test connectivity/access. I was testing this primarily for the purpose of quickly and easily accessing the various API urls to get information from the browser. But it looks like I do need to pass token information in the headers for authentication and hence it is not easy to use it from the browser. Somehow I thought it worked before but I think I was confused. I was running microk8s on ubuntu at that time and was using ssh port forwarding to help simplify some of this setup.

Microk8s used to open the insecure port but it is no longer open.
If you need the certs, you can get it from /var/snap/microk8s/current/certs.

Ok, that makes sense. Thanks for all your feedback.

Sorry if this is basic question: I tried to import the certs into my Chrome but it said that they were invalid. What would you recommend to do?

(trying to avoid the https warning and the 401 Auth failure)