Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Docker 我的cloudbuild.yaml失败了。请查看我的cloudbuild.yaml_Docker_Kubernetes_Google Cloud Build - Fatal编程技术网

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

Docker 我的cloudbuild.yaml失败了。请查看我的cloudbuild.yaml,docker,kubernetes,google-cloud-build,Docker,Kubernetes,Google Cloud Build,我正在尝试将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: ste

我正在尝试将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

在步骤3中,有双引号
name:“gcr.io/cloud builders/kubectl”


如果用单引号替换,问题应该得到解决。

为什么在第3阶段使用双引号
-名称:“gcr.io/cloud builders/kubectl”
?这应该是一个打字错误。。让我试着不说“谢谢”双引号是问题所在。现在它可以工作了。
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