Kubernetes GKE上的CI CD管道-部署失败(“部署”:错误:未传递要应用的对象)

Kubernetes GKE上的CI CD管道-部署失败(“部署”:错误:未传递要应用的对象),kubernetes,google-cloud-platform,google-kubernetes-engine,continuous-deployment,google-cloud-build,Kubernetes,Google Cloud Platform,Google Kubernetes Engine,Continuous Deployment,Google Cloud Build,我正在为GKE上的Spring boot应用程序设置CI CD管道。CI生成步骤工作正常,但传递生成步骤由于“错误:未传递要应用的对象”错误而失败。我可以在云构建中看到下面的日志 starting build "0b2761ac-15e0-4dc7-bd37-595ae2ce6916" FETCHSOURCE Initialized empty Git repository in /workspace/.git/ From https://source.developers.googl

我正在为GKE上的Spring boot应用程序设置CI CD管道。CI生成步骤工作正常,但传递生成步骤由于“错误:未传递要应用的对象”错误而失败。我可以在云构建中看到下面的日志

    starting build "0b2761ac-15e0-4dc7-bd37-595ae2ce6916"

FETCHSOURCE
Initialized empty Git repository in /workspace/.git/
From https://source.developers.google.com/p/amcartecom/r/eureka-cloudbuild-env
 * branch            ebd6994bed5bc58e37567156451c2fb957ae4fbd -> FETCH_HEAD
HEAD is now at ebd6994 Deploying image gcr.io/amcartecom/eureka-cloudbuild:v1 Built from commit a61084943388477a490cfabf5430a93c699f0574 of repository eureka-cloudbuild-app Author: nsingla8585 <nsingla85@gmail.com>
BUILD
Starting Step #0 - "Deploy"
Step #0 - "Deploy": Already have image (with digest): gcr.io/cloud-builders/kubectl
Step #0 - "Deploy": Running: gcloud container clusters get-credentials --project="amcartecom" --zone="us-central1-b" "hello-cloudbuild"
Step #0 - "Deploy": Fetching cluster endpoint and auth data.
Step #0 - "Deploy": kubeconfig entry generated for hello-cloudbuild.
Step #0 - "Deploy": Running: kubectl apply -f kubernetes.yaml
Step #0 - "Deploy": error: no objects passed to apply
Finished Step #0 - "Deploy"
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/kubectl" failed: exit status 1
开始构建“0b2761ac-15e0-4dc7-bd37-595ae2ce6916”
获取源
已在/workspace/.Git中初始化空Git存储库/
从…起https://source.developers.google.com/p/amcartecom/r/eureka-cloudbuild-env
*分支ebd6994bed5bc58e37567156451c2fb957ae4fbd->取头
HEAD现在位于ebd6994部署映像gcr.io/amcartecom/eureka cloudbuild:v1由存储库eureka cloudbuild应用程序的提交a61084943388477a490cfabf5430a93c699f0574构建作者:nsingla8585
建造
开始步骤#0-“部署”
步骤0-“部署”:已经有映像(带有摘要):gcr.io/cloud-builders/kubectl
步骤0-“部署”:运行:gcloud容器集群获取凭据--project=“amcartecom”--zone=“us-central1-b”hello cloudbuild
步骤0-“部署”:获取集群端点和身份验证数据。
步骤0-“部署”:为hello cloudbuild生成的kubeconfig条目。
步骤0-“部署”:运行:kubectl apply-f kubernetes.yaml
步骤0-“部署”:错误:没有传递要应用的对象
已完成步骤0-“部署”
错误
错误:生成步骤0“gcr.io/cloud builders/kubectl”失败:退出状态1

为了设置此管道,我遵循了从您收到的错误消息中的

中提到的所有指导原则,您的kubernetes.yaml文件似乎有问题。您能用该文件中包含的内容更新问题吗?要完成siamsot评论,我想说查看您的错误,kubernetes.yaml文件在您当前路径中不存在。。。让您的存储库支持文件也会有所帮助,我看到了类似的其他讨论线程,通过在源代码管理中添加模板文件(kubectl.yaml.tpl)解决了这个问题。我希望这个帮助我在生成清单的第4步中发现了问题,开始第4步-“生成清单”第4步-“生成清单”:已经有图像(带有摘要):gcr.io/cloud-builders/gcloud-Step#4-“生成清单”:sed:无法读取kubernetes.yaml.tpl:没有这样的文件或目录完成了第4步-“生成清单”根据,似乎“.tpl”文件应该在您的“应用程序”存储库中,而不是在“环境”存储库中。您可以再次检查吗?