The full deployment life cycle of an application on Google Kubernetes Engine and Cloud Run
Now that we have reviewed the basic concepts of Kubernetes, GKE, and Cloud Run, it is possible to explore the steps needed to deploy an application and how to expose it to the internet to be consumed by either users or other applications.
Building a container image using Cloud Build
The first thing we need to do to deploy an application in a cluster created in GKE or in Cloud Run is to create an image of a container of our application. For this, our application must have previously created its Dockerfile. By having the Google SDK installed in our local environment or by using Cloud Shell, we can use Cloud Build to generate our image and upload it directly to the GCP image repository called Google Container Registry.
To build the image, we use the following command, assuming that we are at the root of the project where the Dockerfile is located:
gcloud build submit –tag gcr...