k3sにhelmのインストールで遭遇したエラー

k3sにhelmをインストールした場合に以下のエラー。

$ helm list
Error: Kubernetes cluster unreachable: Get "http://localhost:8080/version": dial tcp 127.0.0.1:8080: connect: connection refused

helm がクラスタにアクセスするためのkubeconfigが無いためのようである。 以下のコマンドを実行し、回避する。

$ kubectl config view --raw >~/.kube/config
$ helm list
WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /home/ubuntu/.kube/config
WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /home/ubuntu/.kube/config
NAME    NAMESPACE       REVISION        UPDATED STATUS  CHART   APP VERSION