【问题标题】:Can't do Helm Init : tiller not found [duplicate]无法执行 Helm Init:找不到分蘖 [重复]
【发布时间】:2020-01-29 14:51:59
【问题描述】:

我正在尝试使用 Helm 在我的集群上的 Ubuntu 18.10 主服务器上安装 Traefik。

我可以使用 snap snap install helm --classic 安装 Helm,但是当我想使用 helm init 命令安装 Tiller 时,我有以下输出:

helm init                                                                                         
Creating /home/user/.helm                                                                                            
Creating /home/user/.helm/repository                                                                                 
Creating /home/user/.helm/repository/cache                                                                           
Creating /home/user/.helm/repository/local                                                                           
Creating /home/user/.helm/plugins                                                                                    
Creating /home/user/.helm/starters                                                                                   
Creating /home/user/.helm/cache/archive                                                                              
Creating /home/user/.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/user/.helm.                                                                  
Error: error installing: the server could not find the requested resource  

我尝试通过官方 GitHub 上的二进制文件安装 helm,但以同样的错误结束。

我也尝试通过运行手动安装 Tiller:

helm init --dry-run --debug >> tiller.yml

但是当我执行kubectl apply -f tiller.yml 时,它说找不到扩展/v1beta1。

我的解决方案已经用完了,所以如果您有任何想法,我请求您的帮助!

---                                                                                                                      
apiVersion: extensions/v1beta1                                                                                           
kind: Deployment                                                                                                         
metadata:                                                                                                                
  creationTimestamp: null                                                                                                
  labels:                                                                                                                
    app: helm                                                                                                            
    name: tiller                                                                                                         
  name: tiller-deploy                                                                                                    
  namespace: kube-system  
spec:                                                                                                                    
  replicas: 1                                                                                                            
  strategy: {}                                                                                                           
  template:                                                                                                              
    metadata:                                                                                                            
      creationTimestamp: null                                                                                            
      labels:                                                                                                            
        app: helm                                                                                                        
        name: tiller                                                                                                     
    spec:                                                                                                                
      automountServiceAccountToken: true                                                                                 
      containers:                                                                                                        
      - env:                                                                                                             
        - name: TILLER_NAMESPACE                                                                                         
          value: kube-system                                                                                             
        - name: TILLER_HISTORY_MAX                                                                                       
          value: "0"                                                                                                     
        image: gcr.io/kubernetes-helm/tiller:v2.14.3                                                                     
        imagePullPolicy: IfNotPresent                                                                                    
        livenessProbe:                                                                                                   
          httpGet:
          httpGet:                                                                                                       
            path: /liveness                                                                                              
            port: 44135                                                                                                  
          initialDelaySeconds: 1                                                                                         
          timeoutSeconds: 1                                                                                              
        name: tiller                                                                                                     
        ports:                                                                                                           
        - containerPort: 44134                                                                                           
          name: tiller                                                                                                   
        - containerPort: 44135                                                                                           
          name: http                                                                                                     
        readinessProbe:                                                                                                  
          httpGet:                                                                                                       
            path: /readiness                                                                                             
            port: 44135                                                                                                  
          initialDelaySeconds: 1                                                                                         
          timeoutSeconds: 1                                                                                              
        resources: {}                                                                                                    
status: {}

---                                                                                                                      
apiVersion: v1                                                                                                           
kind: Service                                                                                                            
metadata:                                                                                                                
  creationTimestamp: null                                                                                                
  labels:                                                                                                                
    app: helm                                                                                                            
    name: tiller                                                                                                         
  name: tiller-deploy                                                                                                    
  namespace: kube-system                                                                                                 
spec:                                                                                                                    
  ports:                                                                                                                 
  - name: tiller                                                                                                         
    port: 44134                                                                                                          
    targetPort: tiller                                                                                                   
  selector:                                                                                                              
    app: helm                                                                                                            
    name: tiller                                                                                                         
  type: ClusterIP                                                                                                        
status:                                                                                                                  
  loadBalancer: {}                                                                                                       

...        

【问题讨论】:

  • 你的k8s 1.16版本是多少?
  • 如果是 k8s 1.16 版,there 是我在另一个问题中的答案的链接,错误相同。
  • 我的k8s版本是1.16,不知道这个版本有问题,谢谢帮忙我会尝试降级的!
  • 我不必降级,您的解决方法就像一个魅力!感谢您的帮助!
  • Helm v2.15.0 已发布,helm init 现在使用 apiVersion apps/v1 安装 Tiller 部署,使其与新版本的 Kubernetes 兼容。

标签: kubernetes kubernetes-helm


【解决方案1】:

解决方法,使用命令:

helm init --service-account tiller --output yaml | sed 的@apiVersion: extensions/v1beta1@apiVersion: 应用程序/v1@' | sed 's@ 副本:1@ 副本:1\n 选择器:{“matchLabels”:{“app”:“helm”,“name”: "分蘖"}}@' | kubectl apply -f -

如果k8s版本是:1.16,你应该降级到1.14。

【讨论】:

  • 分蘖的RBAC怎么样?
  • 我的k8s版本是1.16,不知道这个版本有问题,感谢帮助我会尝试降级!
【解决方案2】:

如果是 k8s 1.16 版,there 是我在另一个答案中的链接 有同样错误的问题。 – jt97

jt97 的评论是完美的解决方法,谢谢!

【讨论】:

    猜你喜欢
    • 2020-01-25
    • 1970-01-01
    • 2019-08-27
    • 2020-08-07
    • 2021-12-31
    • 2020-06-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多