Open In App

Deploy Application into Google Kubernetes Engine using the Cloud Build

Last Updated : 22 Aug, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

Google Kubernetes Engine is a very efficient and powerful cluster management system and coordination framework for running your Docker containers. It's based on the open-source Kubernetes framework.

What are CI/CD Pipelines?

Before understanding the deployment of applications into the Google Kubernetes engine, we will have to understand what is CI/CD, it is a method for automation of the creation, testing, and deployment of programming. It makes sure that the product is reliable and tends to be quickly delivered.

Continuous Integration is known as CI. The form and test periods of the product advancement lifecycle are computerized through this technique. Continuous delivery is known as CD. The deployment of the project to a production environment is automated during this technique.

You can construct a pipeline that ensures your product is of consistent quality and that it is very well and has reliable delivery by CI and CD.

Setting Up Google Kubernetes Engine (GKE) and Configuring Cloud Build

The steps that are required for setting up the Google Kubernetes engine and configuration of the cloud build are mentioned below:

Step 1: Open the Kubernetes engine

The first step is to open the Kubernetes engine, for simply go to Google Cloud search for Kubernetes engine, and open it.

Open Kubernetes engine
Open kubernetes engine.

Step 2: Open workloads menu

Next step after opening the kubernetes engine is to open the workloads menu so that we can create and manage the kubernetes workloads.

Open workloads menu.

Step 3: Open source repositories

After the workloads menu is being shown, we can say that there is no error in google cloud and move forward to opening the cloud source repositories, I am using this repository as an example to show how to set it up, you can choose your project repository.

Open source repositories.

Step 4: Open repository settings:

After opening your repository, you will have to go to the top right corner and open the settings menu:

Open repository settings.

Step 5: Open cloud build triggers

Next step is to open the cloud build triggers to set the triggers so that the deploy of the cloud build could be completed.

Open cloud build triggers.

Once we have completed all above steps and managed to create and access a repository, we will move to next steps to create and push the docker images to google container registry.

Creating and Pushing Docker Images to Google Container Registry

Add trigger details for push

Next step is to add the trigger details for the push which will the details for the trigger, do not make unnecessary changes to the trigger settings, only make required changes.

Add trigger details for push.

Make sure to select the file for cloud build as /cloudbuild.yaml file to push the docker images successfully.

Run the push trigger:

Once the trigger is ready simply click on the RUN button next to the status option and then click on the run trigger option, this will push the trigger of the docker images.

Run the push trigger.

Automating Application Deployment to GKE using Cloud Build

Once the pushing of docker images are completed, we can see them in the deployment window:

Deployment log.

Now once the deployment is completed, we can see that the docker pods will start to run automatically because of the trigger which was fired in the before steps, so check of there are any pods deployed and running in the workloads section of the repository.

pods deployed and running.

Now in the bottom we have the exposing services which gives us the endpoints of the project to view the output, simply click on this IP address link and it will provide the output of the deployed application into the google kubernetes engine via the cloud build.

Deployed application into the google Kubernetes engine.

This is how we can successfully deploy any application into the google kubernetes engine using the cloud build.


Next Article
Article Tags :

Similar Reads