我正在尝试为kubernetes集群设置一个react应用程序。我所有的kubernetes文件都驻留在k8s/文件夹中。在k8s/文件夹中,我有一个deployment.yaml和service.yaml文件。
下面是驻留在根文件夹中的cloudbuild.yaml文件。这部分gcr.io/cloud-builders/kubectl第三阶段失败了。我得到以下错误
build step 2 "gcr.io/cloud-builders/kubectl" failed: step exited with non-zero status: 1steps:
# Build the image - Stage 1
- name: 'gcr.io/cloud-builders/docker'
args: ['build','-t','gcr.io/${_PROJECT}/${_CONTAINERNAME}:${_VERSION}','.']
timeout: 1500s
# Push the image - Stage 2
- name: 'gcr.io/cloud-builders/docker'
args: ['push','gcr.io/${_PROJECT}/${_CONTAINERNAME}:${_VERSION}']
# Deploy changes to kubernetes config files - Stage 3
- name: "gcr.io/cloud-builders/kubectl"
args: ["apply", "-f", "k8s/"]
env:
- 'CLOUDSDK_COMPUTE_ZONE=${_ZONE}'
- 'CLOUDSDK_CONTAINER_CLUSTER=${_GKE_CLUSTER}'
# These are variable substitutions
substitutions:
#GCP Specific configuration. Please DON'T change anything
_PROJECT: my-projects-121212
_ZONE: us-central1-c
_GKE_CLUSTER: cluster-1
#Repository Specific configuration. DevOps can change this settings
_DEPLOYMENTNAME: react
_CONTAINERNAME: react
_REPO_NAME: react-app
# Developers ONLY change
_VERSION: v1.0
options:
substitution_option: 'ALLOW_LOOSE'
machineType: 'N1_HIGHCPU_8'
timeout: 2500s发布于 2020-11-02 19:57:00
在步骤3中,有双引号name: "gcr.io/cloud-builders/kubectl"。
如果你用单引号代替他们,问题应该是固定的。
https://stackoverflow.com/questions/64646861
复制相似问题