无法执行Helm Init:找不到分till

时间:2019-09-30 10:10:41

标签: kubernetes kubernetes-helm

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

我能够使用快照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上的二进制文件安装头盔,但以相同的错误结束。

我还尝试通过运行以下命令手动安装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: {}                                                                                                       

...        

2 个答案:

答案 0 :(得分:1)

解决方法,使用命令:

  

helm init --service-accounter --output yaml | sed的s @ apiVersion:   扩展程序/ v1beta1 @ apiVersion:apps / v1 @'| sed's @副本:1 @   副本:1 \ n选择器:{“ matchLabels”:{“ app”:“ helm”,“ name”:   “ tiller”}} @'| kubectl套用-f-

如果k8s版本为:1.16,则应降级为1.14。

答案 1 :(得分:0)

  

如果它是k8s版本1.16,则there链接到我的答案中   相同错误的问题。 – jt97

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