头盔未初始化

时间:2019-10-17 12:24:08

标签: kubernetes-helm

我正在尝试使用“ helm init ”命令以及“ helm init --wait ”初始化头盔图表。但是,当我运行命令时,我只会收到以下消息,

$HELM_HOME has been configured at /home/docker/.helm.
Error: error installing: the server could not find the requested resource

“ helm version”命令的结果如下,

Client: &version.Version{SemVer:"v2.14.3", 
GitCommit:"0e7f3b6637f7af8fcfddb3d2941fcc7cbebb0085", GitTreeState:"clean"}
Error: could not find tiller

更新正在运行的命令以进行故障排除

kubectl -n kube-system获取吊舱

NAME                                       READY   STATUS    RESTARTS   AGE
calico-kube-controllers-6c9c86c88b-5wngt   1/1     Running   0          42h
calico-node-cvbdb                          1/1     Running   1          42h
calico-node-rpt9v                          1/1     Running   0          42h
coredns-58687784f9-nnq6g                   1/1     Running   5          42h
coredns-58687784f9-sc6p5                   1/1     Running   8          42h
dns-autoscaler-79599df498-wv7cp            1/1     Running   0          42h
kube-apiserver-mildevkub030                1/1     Running   0          42h
kube-controller-manager-mildevkub030       1/1     Running   3          42h
kube-proxy-wb7gp                           1/1     Running   0          42h
kube-proxy-xll9c                           1/1     Running   0          42h
kube-scheduler-mildevkub030                1/1     Running   0          42h
kubernetes-dashboard-556b9ff8f8-6kls9      1/1     Running   0          42h
nginx-proxy-mildevkub040                   1/1     Running   0          42h
nodelocaldns-kfrlm                         1/1     Running   0          42h
nodelocaldns-tvclh                         1/1     Running   0          42h
tiller-deploy-77855d9dcf-l4l85             1/1     Running   0          100m

kubectl -n kube-system进行部署

NAME                      READY   UP-TO-DATE   AVAILABLE   AGE
calico-kube-controllers   1/1     1            1           42h
coredns                   2/2     2            2           42h
dns-autoscaler            1/1     1            1           42h
kubernetes-dashboard      1/1     1            1           42h
tiller-deploy             1/1     1            1           21h 

kubectl -n kube-system描述部署分till部署

Name:                   tiller-deploy
Namespace:              kube-system
CreationTimestamp:      Thu, 17 Oct 2019 07:43:17 -0400
Labels:                 app=helm
                    name=tiller
Annotations:            deployment.kubernetes.io/revision: 1
                    kubectl.kubernetes.io/last-applied-configuration:

{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations": 
{},"creationTimestamp":null,"labels":{"app":"helm","name":"tiller"},...
Selector:               app=helm,name=tiller
Replicas:               1 desired | 1 updated | 1 total | 1 available | 0 
unavailable
StrategyType:           RollingUpdate
MinReadySeconds:        0
RollingUpdateStrategy:  25% max unavailable, 25% max surge
Pod Template:
  Labels:           app=helm
                name=tiller
  Service Account:  tiller
Containers:
tiller:
 Image:       gcr.io/kubernetes-helm/tiller:v2.14.3
 Ports:       44134/TCP, 44135/TCP
 Host Ports:  0/TCP, 0/TCP
 Liveness:    http-get http://:44135/liveness delay=1s timeout=1s period=10s #success=1 #failure=3
Readiness:   http-get http://:44135/readiness delay=1s timeout=1s period=10s #success=1 #failure=3
  Environment:
   TILLER_NAMESPACE:    kube-system
   TILLER_HISTORY_MAX:  0
 Mounts:                <none>
Volumes:                 <none>
Conditions:
 Type           Status  Reason
 ----           ------  ------
  Available      True    MinimumReplicasAvailable
  Progressing    True    NewReplicaSetAvailable
 OldReplicaSets:  <none>
NewReplicaSet:   tiller-deploy-77855d9dcf (1/1 replicas created)
Events:          <none>

1 个答案:

答案 0 :(得分:1)

  1. 重置头盔:
helm reset --force
  1. 为启用RBAC的群集创建服务帐户。

    rbac-config.yaml中:

apiVersion: v1
kind: ServiceAccount
metadata:
  name: tiller
  namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: tiller
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
  - kind: ServiceAccount
    name: tiller
    namespace: kube-system
$ kubectl create -f rbac-config.yaml
serviceaccount "tiller" created
clusterrolebinding "tiller" created
  1. 初始化头盔:

尝试第一个命令,如果它不起作用,请尝试第二个命令。

$ helm init --service-account tiller --history-max 200
$ helm init --service-account tiller --override spec.selector.matchLabels.'name'='tiller',spec.selector.matchLabels.'app'='helm' --output yaml | sed 's@apiVersion: extensions/v1beta1@apiVersion: apps/v1@' | kubectl apply -f -