CI CD Pipeline on GKE - Deployment failing ("Deploy": error: no objects passed to apply)

11/4/2019

I am working on setting up CI CD pipeline for Spring boot application on GKE. The CI build step worked correctly but the delivery build step is failing due to 'error: no objects passed to apply' error. I could see below logs in the cloud build

    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

To set up this pipeline, I followed all the guidelines mentioned at https://cloud.google.com/kubernetes-engine/docs/tutorials/gitops-cloud-build

-- user1986760
continuous-deployment
google-cloud-build
google-cloud-platform
google-kubernetes-engine
kubernetes

0 Answers