我的 cloudbuild.yaml 失败了。请查看我的 cloudbuild.yaml

My cloudbuild.yaml is failing. Please review my cloudbuild.yaml

我正在尝试将 React 应用程序设置为 kubernetes 集群。我所有的 kubernetes 文件都位于 k8s/ 文件夹中。在 k8s/ 文件夹中,我有一个 deployment.yaml 和 service.yaml 文件。

下面是我的 cloudbuild.yaml 文件,它位于根文件夹中。这部分 gcr.io/cloud-builders/kubectl 第 3 阶段失败。我收到以下错误

build step 2 "gcr.io/cloud-builders/kubectl" failed: step exited with non-zero status: 1
steps:

# 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

第3步中有双引号name: "gcr.io/cloud-builders/kubectl"

如果将它们替换为单引号,问题应该得到解决。