使用值和命名空间升级 Helm

问题描述 投票:0回答:2

我需要升级舵图中的一些值:

EC2-TEST@~>helm list -A
NAME    NAMESPACE   REVISION    UPDATED                                 STATUS      CHART           APP VERSION
jenkins jenkins     1           2021-06-23 09:21:28.245050889 +0000 UTC deployed    jenkins-3.4.0   2.289.1
EC2-TEST@~>helm repo list
NAME        URL
jenkinsci   https://charts.jenkins.io

图表部署使用:

helm install jenkins -n jenkins -f jenkins-values.yaml

同一文件夹中新更改的 yaml 图表名称为

new-values-jenkins.yaml

尝试了很多变体,看起来像是语法问题,出现以下错误:

Error: "helm upgrade" requires 2 arguments

Usage:  helm upgrade [RELEASE] [CHART] [flags]

或:

error: file '/home/ec2-user/jenkins-values.yaml' seems to be a YAML file, but expected a gzipped archive

我尝试过的变化

EC2-TEST@~>helm upgrade -f Jenkins-default-helm.yaml jenkins ./jenkins-values.yaml
Error: file '/home/ec2-user/jenkins-values.yaml' seems to be a YAML file, but expected a gzipped archive
EC2-TEST@~>helm upgrade -f Jenkins-default-helm.yaml jenkins ./jenkins-values.yaml -n jenkins
Error: file '/home/ec2-user/jenkins-values.yaml' seems to be a YAML file, but expected a gzipped archive
EC2-TEST@~>helm upgrade ./jenkins-values.yaml -f Jenkins-default-helm.yaml -n jenkins
Error: "helm upgrade" requires 2 arguments

Usage:  helm upgrade [RELEASE] [CHART] [flags]
EC2-TEST@~>helm upgrade ./jenkins-values.yaml -f Jenkins-default-helm.yaml
Error: "helm upgrade" requires 2 arguments

Usage:  helm upgrade [RELEASE] [CHART] [flags]
EC2-TEST@~>helm upgrade jenkins  ./jenkins-values.yaml -f Jenkins-default-helm.yaml
Error: file '/home/ec2-user/jenkins-values.yaml' seems to be a YAML file, but expected a gzipped archive
EC2-TEST@~>helm upgrade jenkins ./jenkins-values.yaml --values ./Jenkins-default-helm.yaml -n jenkins
Error: file '/home/ec2-user/jenkins-values.yaml' seems to be a YAML file, but expected a gzipped archive
EC2-TEST@~>helm upgrade jenkins jenkinsci/jenkins-3.4.0 --values ./Jenkins-default-helm.yaml -n jenkins
Error: failed to download "jenkinsci/jenkins-3.4.0" (hint: running `helm repo update` may help)
EC2-TEST@~>helm upgrade jenkins https://charts.jenkins.io --values ./Jenkins-default-helm.yaml -n jenkins
Error: failed to download "https://charts.jenkins.io" (hint: running `helm repo update` may help)
EC2-TEST@~>helm upgrade jenkins --values Jenkins-default-helm.yaml --namespace jenkins
Error: "helm upgrade" requires 2 arguments

Usage:  helm upgrade [RELEASE] [CHART] [flags]
EC2-TEST@~>helm upgrade jenkins-values.yaml --values Jenkins-default-helm.yaml --namespace jenkins
Error: "helm upgrade" requires 2 arguments

Usage:  helm upgrade [RELEASE] [CHART] [flags]
EC2-TEST@~>helm upgrade jenkins --values Jenkins-default-helm.yaml -n jenkins
Error: "helm upgrade" requires 2 arguments

Usage:  helm upgrade [RELEASE] [CHART] [flags]
EC2-TEST@~>helm upgrade  --values Jenkins-default-helm.yaml -n jenkins
Error: "helm upgrade" requires 2 arguments

Usage:  helm upgrade [RELEASE] [CHART] [flags]
EC2-TEST@~>helm upgrade jenkins -f Jenkins-default-helm.yaml -n jenkins
Error: "helm upgrade" requires 2 arguments

Usage:  helm upgrade [RELEASE] [CHART] [flags]
EC2-TEST@~>helm upgrade jenkins -f Jenkins-default-helm.yaml -n jenkins
Error: "helm upgrade" requires 2 arguments

Usage:  helm upgrade [RELEASE] [CHART] [flags]
EC2-TEST@~>helm upgrade jenkins -f Jenkins-default-helm.yaml
Error: "helm upgrade" requires 2 arguments

Usage:  helm upgrade [RELEASE] [CHART] [flags]
EC2-TEST@~>helm upgrade -n jenkins  jenkins -f Jenkins-default-helm.yaml
Error: "helm upgrade" requires 2 arguments

Usage:  helm upgrade [RELEASE] [CHART] [flags]
EC2-TEST@~>helm upgrade -n jenkins  jenkins --values Jenkins-default-helm.yaml
Error: "helm upgrade" requires 2 arguments

Usage:  helm upgrade [RELEASE] [CHART] [flags]
EC2-TEST@~>helm upgrade -n jenkins jenkins --values Jenkins-default-helm.yaml
Error: "helm upgrade" requires 2 arguments

Usage:  helm upgrade [RELEASE] [CHART] [flags]
EC2-TEST@~>helm upgrade jenkins --values Jenkins-default-helm.yaml -n jenkins
Error: "helm upgrade" requires 2 arguments

Usage:  helm upgrade [RELEASE] [CHART] [flags]
EC2-TEST@~>helm upgrade jenkins --values Jenkins-default-helm.yaml --namespace jenkins
Error: "helm upgrade" requires 2 arguments

Usage:  helm upgrade [RELEASE] [CHART] [flags]
EC2-TEST@~>helm upgrade jenkins-v --values Jenkins-default-helm.yaml --namespace jenkins
jenkins-values.yaml  jenkins-volume.yaml
EC2-TEST@~>helm upgrade jenkins-v --values Jenkins-default-helm.yaml --namespace jenkins
jenkins-values.yaml  jenkins-volume.yaml
EC2-TEST@~>helm upgrade jenkins-values.yaml --values Jenkins-default-helm.yaml --namespace jenkins
Error: "helm upgrade" requires 2 arguments

Usage:  helm upgrade [RELEASE] [CHART] [flags]

对正确语法(包括命名空间)有任何帮助吗

感谢! (带有回滚功能的选项也很好,以防万一)

** 参考:https://helm.sh/docs/helm/helm_upgrade/

kubernetes-helm
2个回答
2
投票

所以问题是您在命令中缺少实际的图表参考。从这个意义上说,您的安装命令也不正确(也许这部分由于最初的复制粘贴问题或其他问题而丢失)。

您的安装命令应该是:

helm install jenkins -n jenkins -f jenkins-values.yaml jenkinsci/jenkins

你的升级命令应该是:

helm upgrade jenkins -n jenkins -f jenkins-values.yaml jenkinsci/jenkins

或使用您的其他值文件:

helm upgrade jenkins -n jenkins -f Jenkins-default-helm.yaml jenkinsci/jenkins

本质上,请注意您缺少实际的图表参考 -

jenkinsci/jenkins
部分。


0
投票

这对我有用,使用 jenkins/jenkins 作为我的图表

helm ls -n jenkins
NAME    NAMESPACE       REVISION        UPDATED                                 STATUS          CHART           APP VERSION
jenkins jenkins         46              2023-04-15 12:19:49.9738769 +0800 +08   deployed        jenkins-4.1.9   2.332.3

helm upgrade jenkins jenkins/jenkins --version x.x.x -n jenkins -f <values.yml> --dry-run --debug
© www.soinside.com 2019 - 2024. All rights reserved.