【问题标题】:Kubernetes Helm install stable/jenkins deprecation error calling Master.* valuesKubernetes Helm install stable/jenkins deprecation error calling Master.* values
【发布时间】:2020-04-26 01:18:49
【问题描述】:

嘿,尝试使用此命令在 GKE 集群上安装 jenkins

helm install stable/jenkins -f test_values.yaml --name myjenkins

如果重要的话,我的 helm 和 kubectl 版本

helm version
Client: &version.Version{SemVer:"v2.13.0", GitCommit:"79d07943b03aea2b76c12644b4b54733bc5958d6", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.13.0", GitCommit:"79d07943b03aea2b76c12644b4b54733bc5958d6", GitTreeState:"clean"}
kubectl version
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-13T11:51:44Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"13+", GitVersion:"v1.13.11-gke.14", GitCommit:"56d89863d1033f9668ddd6e1c1aea81cd846ef88", GitTreeState:"clean", BuildDate:"2019-11-07T19:12:22Z", GoVersion:"go1.12.11b4", Compiler:"gc", Platform:"linux/amd64"}

使用此命令helm inspect values stable/jenkins > test_values.yaml 下载并修改的值:

cat test_values.yaml
Master:
  adminPassword: 34LbGfq5LWEUgw // local testing
  resources:
    limits:
      cpu: '500m'
      memory: '1024'
  podLabels:
    nodePort: 32323
  serviceType: ClusterIp

Persistence:
  storageClass: 'managed-nfs-storage'
  size: 5Gi

rbac:
  create: true

更新后出现一些奇怪的新错误

$ helm install stable/jekins --name myjenkins -f test_values.yaml
Error: failed to download "stable/jekins" (hint: running `helm repo update` may help)
$ helm repo update
Hang tight while we grab the latest from your chart repositories...
...Skip local chart repository
...Successfully got an update from the "stable" chart repository
Update Complete. ⎈ Happy Helming!⎈
$ helm install stable/jekins --name myjenkins -f test_values.yaml
Error: failed to download "stable/jekins" (hint: running `helm repo update` may help)

【问题讨论】:

    标签: jenkins kubernetes google-cloud-platform google-kubernetes-engine kubernetes-helm


    【解决方案1】:

    正如我所见,您正在尝试安装不在 helm repo 中的 stable/jekins 而不是 stable/jenkins。如果只是拼写错误,请更新您的问题,我会更新我的答案,但我已经尝试过您的命令:

    $helm install stable/jekins --name myjenkins -f test_values.yaml
    

    得到了同样的错误:

    Error: failed to download "stable/jekins" (hint: running `helm repo update` may help)
    

    EDIT 解决下一个错误,例如:

    Error: render error in "jenkins/templates/deprecation.yaml": template: jenkins/templates/deprecation.yaml:258:11: executing "jenkins/templates/deprecation.yaml" at <fail "Master.* values have been renamed, please check the documentation">: error calling fail: Master.* values have been renamed, please check the documentation
    

    Error: render error in "jenkins/templates/deprecation.yaml": template: jenkins/templates/deprecation.yaml:354:10: executing "jenkins/templates/deprecation.yaml" at <fail "Persistence.* values have been renamed, please check the documentation">: error calling fail: Persistence.* values have been renamed, please check the documentation
    

    等等你还需要编辑test_values.yaml

    master:
      adminPassword: 34LbGfq5LWEUgw
      resources:
        limits:
          cpu: 500m
          memory: 1Gi
      podLabels:
        nodePort: 32323
      serviceType: ClusterIP
    
    persistence:
      storageClass: 'managed-nfs-storage'
      size: 5Gi
    
    rbac:
      create: true
    

    然后就成功部署了:

    $helm install stable/jenkins --name myjenkins -f test_values.yaml
    NAME:   myjenkins
    LAST DEPLOYED: Wed Jan  8 15:14:51 2020
    NAMESPACE: default
    STATUS: DEPLOYED
    
    RESOURCES:
    ==> v1/ConfigMap
    NAME             AGE
    myjenkins        1s
    myjenkins-tests  1s
    
    ==> v1/Deployment
    NAME       AGE
    myjenkins  0s
    
    ==> v1/PersistentVolumeClaim
    NAME       AGE
    myjenkins  1s
    
    ==> v1/Pod(related)
    NAME                        AGE
    myjenkins-6c68c46b57-pm5gq  0s
    
    ==> v1/Role
    NAME                       AGE
    myjenkins-schedule-agents  1s
    
    ==> v1/RoleBinding
    NAME                       AGE
    myjenkins-schedule-agents  0s
    
    ==> v1/Secret
    NAME       AGE
    myjenkins  1s
    
    ==> v1/Service
    NAME             AGE
    myjenkins        0s
    myjenkins-agent  0s
    
    ==> v1/ServiceAccount
    NAME       AGE
    myjenkins  1s
    
    
    NOTES:
    1. Get your 'admin' user password by running:
      printf $(kubectl get secret --namespace default myjenkins -o jsonpath="{.data.jenkins-admin-password}" | base64 --decode);echo
    2. Get the Jenkins URL to visit by running these commands in the same shell:
      export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/component=jenkins-master" -l "app.kubernetes.io/instance=myjenkins" -o jsonpath="{.items[0].metadata.name}")
      echo http://127.0.0.1:8080
      kubectl --namespace default port-forward $POD_NAME 8080:8080
    
    3. Login with the password from step 1 and the username: admin
    
    
    For more information on running Jenkins on Kubernetes, visit:
    https://cloud.google.com/solutions/jenkins-on-container-engine
    

    【讨论】:

    • 是的,它解决了这个问题,谢谢,我在 yaml 文件中几乎没有错别字
    【解决方案2】:

    repo stable 很快就会被弃用,并且不会更新。我建议使用来自Helm Hub的詹金斯图表

    【讨论】:

      猜你喜欢
      • 2019-05-11
      • 2019-04-12
      • 1970-01-01
      • 2020-05-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-19
      • 2022-06-16
      • 1970-01-01
      相关资源
      最近更新 更多