Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Helm list tries to connect to localhost rather than Kubernetes

I have a Kubernetes cluster running. All pods are running. This is a windows machine with minikube on it.

However helm ls --debug gives following error

helm ls --debug
[debug] Created tunnel using local port: '57209'

[debug] SERVER: "127.0.0.1:57209"

Error: Get http://localhost:8080/api/v1/namespaces/kube-system/configmaps?labelSelector=OWNER%!D(MISSING)TILLER: dial tcp 127.0.0.1:8080: connect: connection refused

Cluster information

kubectl.exe cluster-info
Kubernetes master is running at https://135.250.128.98:8443

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.

kubectl service

kubectl.exe get svc
NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   3h

Dashboard is accessible at http://135.250.128.98:30000

kube configuration:

apiVersion: v1
clusters:
- cluster:
    certificate-authority: C:\Users\abc\.minikube\ca.crt
    server: https://135.250.128.98:8443
  name: minikube
contexts:
- context:
    cluster: minikube
    user: minikube
  name: minikube
current-context: minikube
kind: Config
preferences: {}
users:
- name: minikube
  user:
    as-user-extra: {}
    client-certificate: C:\Users\abc\.minikube\client.crt
    client-key: C:\Users\abc\.minikube\client.key

Is there a solution? Most online resource says cluster is misconfigured. But not sure what is misconfigured and how to solve this error?

like image 988
Dheeraj Joshi Avatar asked Apr 10 '18 06:04

Dheeraj Joshi


People also ask

How does helm connect to Kubernetes?

Helm client directly interacts with the kubernetes API for the helm chart deployment. So from wherever you are running the helm command, you should have kubectl configured with cluster-admin permissions for helm to execute the manifests in the chart.

How do you resolve the connection to the server localhost 8080 was refused Did you specify the right host or port?

This is a common issue when you run the kubectl command or a similar command. In most cases, Kubernetes does not have the correct credentials to access the cluster. It can be easily resolved easily by setting an environment variable in most similar cases.

Is helm only for Kubernetes?

Helm is an open source project created by DeisLabs and donated to the Cloud Native Computing Foundation, which now maintains it. Helm is a package manager designed specifically for Kubernetes and improves the management of the YAML manifests required to create Kubernetes projects.

How does helm charts work with Kubernetes?

Helm uses a packaging format called Charts. A Helm Chart is a collection of files that describe a set of Kubernetes resources. Like other package manager formats based on convention, Helm Charts follow a directory structure/tree. The Helm Charts can be archived and sent to a Helm Chart Repository.


1 Answers

What worked for me when I was facing the same issue was changing automountServiceAccountToken to true.

Use the following command to edit the tiller-deploy

kubectl --namespace=kube-system edit deployment/tiller-deploy

And change automountServiceAccountToken to true

like image 138
Rebeca Maia Avatar answered Sep 17 '22 18:09

Rebeca Maia