在下面的Google Cloud Build步骤中,我正在使用alpine/helm:3.0.0
- id: 'update helm app'
name: 'alpine/helm:3.0.0'
args: ['upgrade', 'staging', './iprocure-chart/']
env:
- CLOUDSDK_COMPUTE_ZONE=us-central1-a
- CLOUDSDK_CONTAINER_CLUSTER=iprocure-cluster
问题是,当我使用cloud-build-local
运行它时,出现以下错误,并且管道以失败告终
Starting Step #4 - "update helm app"
Step #4 - "update helm app": Already have image (with digest): alpine/helm:3.0.0
Step #4 - "update helm app": Error: UPGRADE FAILED: query: failed to query with labels: Get http://localhost:8080/api/v1/namespaces/default/secrets?labelSelector=name%3Dstaging%2Cowner%3Dhelm%2Cstatus%3Ddeployed: dial tcp 127.0.0.1:8080: connect: connection refused
答案 0 :(得分:1)
这是因为尚未设置或通过配置。 要配置checkout = https://cloud.google.com/cloud-build/docs/build-debug-locally#before_you_begin
,然后在您的构建步骤中添加如下所示的evn:
如果这不起作用,请尝试在helm命令中使用--kubeconfig标志传递配置。 --kubeconfig = / workspace / .kube / config ..