2

I installed Microk8s on a local physical Ubuntu 20-04 server (without a GUI):

 microk8s status --wait-ready
microk8s is running
high-availability: no
  datastore master nodes: 127.0.0.1:19001
  datastore standby nodes: none
addons:
  enabled:
    ha-cluster           # Configure high availability on the current node
    helm                 # Helm 2 - the package manager for Kubernetes
  disabled:

When I try to install something with helm it says:

Error: INSTALLATION FAILED: Kubernetes cluster unreachable: Get "http://localhost:8080/version": dial tcp 127.0.0.1:8080: connect: connection refused

What configuration has to be done to use the MicroK8s Kubernetes cluster for helm installations? Do I have to enable more MicroK8s services for that? Can I run a Kubernetes cluster on one or two single local physical Ubuntu server with MicroK8s?

kkopczak
  • 742
  • 2
  • 8
SQL-Neuling
  • 1,751
  • 2
  • 11
  • 5
  • Did you try [this solution](https://stackoverflow.com/questions/45914420/why-tiller-connect-to-localhost-8080-for-kubernetes-api/59547001#59547001)? – kkopczak Mar 10 '22 at 09:42

1 Answers1

3

Searching for solution for your issue, I have found this one. Try to run:

[microk8s] kubectl config view --raw > ~/.kube/config

Helm interacts directly with the Kubernetes API server so it needs to be able to connect to a Kubernetes cluster. Helms reads the same configuration files used by kubectl to do it automatically.

Based on Learning Helm by O'Reilly Media:

Helm will try to find this information by reading the environment variable $KUBECONFIG. If that is not set, it will look in the same default locations that kubectl looks in.


See also:

kkopczak
  • 742
  • 2
  • 8