dockerkubernetesgoogle-cloud-platformgoogle-cloud-buildskaffold

How to build and deploy kubernetes cluster to Google Cloud using Cloud Build and Skaffold?


I am new to micro-services technologies and getting troubled with Google Cloud Build. I am using Docker, Kubernetes, Ingres Nginx and skaffold and my deployment works fine in local machine.

Now I want to develop locally and build and run remotely using Cloud Platform so, here's what I have done:

Here's my create deployment and skaffold yaml files look like: enter image description here

When I run skaffold dev, it logs out: Some taggers failed. Rerun with -vdebug for errors., then it takes some time and my network bandwidth.

The image does get pushed to Cloud Container Registry and I can access the app using load balancer's IP address but the Cloud Build History is still empty. Where am I missing?

Note: Right now I am not pushing my code to any online repository like github.

Sorry If the information I provide is insufficient, I am new to these technologies.


Solution

  • Cloud Build started working:

    First, In Cloud Build settings, I enabled kubernetes Engine, Compute Engine and Service Accounts.

    Then, I executed these 2 commands:

    1. gcloud auth application-default login: As google describes it This will acquire new user credentials to use for Application Default Credentials

    2. As mentioned in ingress nginx -> deploy -> GCE-GKE documentation, this will Initialize your user as a cluster-admin

    kubectl create clusterrolebinding cluster-admin-binding \
      --clusterrole cluster-admin \
      --user $(gcloud config get-value account)