How do I resolve "Error: "helm template" requires at least 1 argument"?

How do I resolve "Error: "helm template" requires at least 1 argument"?

我正在尝试在 Jenkinsfile 管道中 运行 helm command,但我收到一个错误,它至少需要 1 个参数。下面是代码:

stage ('Create and Deploy to k8s Dev Environment') {
            //agent {label 'docker-maven-slave'}
            options {
                skipDefaultCheckout()
            }
            steps {                    
                    command """
                        echo "hiiiiiiii"
                        helm template -f portal-chart/values-dev.yaml --set image.tag=${IMAGE} | \
                        kubectl apply --server=https://dddd.gggg.com:443 --token='${DEV_NS_TOKEN}' --insecure-skip-tls-verify=true -f -
                    """

}

以下是日志:

+ echo hiiiiiiii
hiiiiiiii
+ helm template -f portal-chart/values-dev.yaml --set image.tag=bde8ac5
+ kubectl apply --server=https://dddd.gggg.com:443 --token=eyjsfkjdhfkjdhfkjdhfkjhfdjhfjdfjZCI6IlI5Zi1YOFpnd2NzcUpUR1czTG45aUhwR2dHMkYx --insecure-skip-tls-verify=true -f -
Error: "helm template" requires at least 1 argument

Usage:  helm template [NAME] [CHART] [flags]
error: no objects passed to apply
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline

请验证我的 helm command 如果我在这里遗漏了什么,请告诉我。

您必须指定 Chart参数。

helm template --help
   Usage:
     helm template [NAME] [CHART] [flags]

你的情况应该是

 helm template -f portal-chart/values-dev.yaml --set image.tag=${IMAGE} portal-chart

-f 只指定值文件!您还必须指定应将其应用于哪个图表。