在k3s中初始化Helm时出错-“服务器找不到所请求的资源”

时间:2019-12-20 22:31:43

标签: kubernetes-helm k3s

我正在使用k3d在docker容器中运行k3s。我的集群信息:

$ kubectl cluster-info
Kubernetes master is running at https://127.0.0.1:6443
CoreDNS is running at https://127.0.0.1:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

并且:

$ k3d list
+-------------+-------------------------------+---------+---------+
|    NAME     |             IMAGE             | STATUS  | WORKERS |
+-------------+-------------------------------+---------+---------+
| k3s-default | docker.io/rancher/k3s:v0.10.0 | running |  10/10  |
+-------------+-------------------------------+---------+---------+

我正在使用以下命令初始化Helm:

$ kubectl -n kube-system create serviceaccount tiller
serviceaccount/tiller created

$ kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
clusterrolebinding.rbac.authorization.k8s.io/tiller created

$ HELM_HOME=/home/mike/.k3s_helm KUBECONFIG=/home/mike/.config/k3d/k3s-default/kubeconfig.yaml helm init --service-account tiller
Creating /home/mike/.k3s_helm 
Creating /home/mike/.k3s_helm/repository 
Creating /home/mike/.k3s_helm/repository/cache 
Creating /home/mike/.k3s_helm/repository/local 
Creating /home/mike/.k3s_helm/plugins 
Creating /home/mike/.k3s_helm/starters 
Creating /home/mike/.k3s_helm/cache/archive 
Creating /home/mike/.k3s_helm/repository/repositories.yaml 
Adding stable repo with URL: https://kubernetes-charts.storage.googleapis.com 
Adding local repo with URL: http://127.0.0.1:8879/charts 
$HELM_HOME has been configured at /home/mike/.k3s_helm.
Error: error installing: the server could not find the requested resource

有什么主意在抱怨什么资源吗?

1 个答案:

答案 0 :(得分:0)

我必须安装较新版本的Helm(v2.16.1)。我使用的是2.14.x。