{"id":118,"date":"2023-05-31T09:37:00","date_gmt":"2023-05-31T09:37:00","guid":{"rendered":"https:\/\/cloudtechner.com\/blog\/?p=118"},"modified":"2024-06-13T10:08:02","modified_gmt":"2024-06-13T10:08:02","slug":"deploying-microservices-in-gke-with-helm-and-cloud-build","status":"publish","type":"post","link":"https:\/\/cloudtechner.com\/blog\/deploying-microservices-in-gke-with-helm-and-cloud-build\/","title":{"rendered":"Deploying Microservices in GKE with Helm and Cloud Build"},"content":{"rendered":"\n<p>Author : <a href=\"https:\/\/www.linkedin.com\/in\/pankaj-holariya-2a948b154\">Pankaj Singh Holariya<\/a>, Senior Engineer &#8211; CloudDevOps<\/p>\n\n\n\n<p>Original Published Date: May 31, 2023<\/p>\n\n\n<div class=\"taxonomy-post_tag wp-block-post-terms\"><a href=\"https:\/\/cloudtechner.com\/blog\/tag\/cloud\/\" rel=\"tag\">Cloud<\/a><span class=\"wp-block-post-terms__separator\">, <\/span><a href=\"https:\/\/cloudtechner.com\/blog\/tag\/cloud-build\/\" rel=\"tag\">Cloud Build<\/a><span class=\"wp-block-post-terms__separator\">, <\/span><a href=\"https:\/\/cloudtechner.com\/blog\/tag\/devops\/\" rel=\"tag\">DevOps<\/a><span class=\"wp-block-post-terms__separator\">, <\/span><a href=\"https:\/\/cloudtechner.com\/blog\/tag\/gcp\/\" rel=\"tag\">GCP<\/a><span class=\"wp-block-post-terms__separator\">, <\/span><a href=\"https:\/\/cloudtechner.com\/blog\/tag\/gke\/\" rel=\"tag\">GKE<\/a><span class=\"wp-block-post-terms__separator\">, <\/span><a href=\"https:\/\/cloudtechner.com\/blog\/tag\/google-cloud\/\" rel=\"tag\">Google Cloud<\/a><span class=\"wp-block-post-terms__separator\">, <\/span><a href=\"https:\/\/cloudtechner.com\/blog\/tag\/helm\/\" rel=\"tag\">Helm<\/a><span class=\"wp-block-post-terms__separator\">, <\/span><a href=\"https:\/\/cloudtechner.com\/blog\/tag\/kubernetes\/\" rel=\"tag\">Kubernetes<\/a><span class=\"wp-block-post-terms__separator\">, <\/span><a href=\"https:\/\/cloudtechner.com\/blog\/tag\/microservices\/\" rel=\"tag\">Microservices<\/a><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*h39yLFkFHazJroZkOuC3kA.png\" alt=\"\"\/><figcaption class=\"wp-element-caption\">Photo by&nbsp;<a href=\"https:\/\/www.linkedin.com\/in\/pankaj-holariya-2a948b154\/?originalSubdomain=in\" rel=\"noreferrer noopener\" target=\"_blank\">Pankaj Holariya<\/a>&nbsp;on&nbsp;<a href=\"https:\/\/excalidraw.com\/\" rel=\"noreferrer noopener\" target=\"_blank\">excalidraw<\/a><\/figcaption><\/figure>\n\n\n\n<p id=\"0ade\">Are you looking to simplify the deployment process of microservices architecture in Google Kubernetes Engine (GKE) while maintaining greater control over your architecture? Look no further, as this tutorial will guide you through deploying microservices to GKE using Helm and Cloud Build.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p id=\"013f\">In the realm of microservice deployments on GKE, Helm and Cloud Build emerge as the dynamic duo, providing the tools and processes needed to orchestrate your architecture with ease.<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"eeaa\">Prerequisites<\/h3>\n\n\n\n<p id=\"94f2\">Before we begin, you should have a basic understanding of Kubernetes, Helm, and GCP. You will need to have the following tools installed and configured:<\/p>\n\n\n\n<ul>\n<li><strong><em>Google Cloud SDK<\/em><\/strong><\/li>\n\n\n\n<li><strong><em>Docker<\/em><\/strong><\/li>\n\n\n\n<li><strong><em>Helm<\/em><\/strong><\/li>\n<\/ul>\n\n\n\n<p id=\"76e5\">You should also have access to a GCP project with the following services enabled:<\/p>\n\n\n\n<ul>\n<li><strong><em>GKE<\/em><\/strong><\/li>\n\n\n\n<li><strong><em>Cloud Build<\/em><\/strong><\/li>\n\n\n\n<li><strong><em>Container Registry<\/em><\/strong><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"bda8\">Pipeline Diagram:<\/h3>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*VkKSQE6c4zoFAVcYD7IJ9Q.png\" alt=\"\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"891b\">Setting up the Project<\/h3>\n\n\n\n<p id=\"4d71\">We will start by creating a new GCP project and enabling the required services. Follow the steps below to set up the project:<\/p>\n\n\n\n<ol>\n<li>Open the GCP Console and create a new project.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*fMA2bZ6ZtnR0mIlxzIowag.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"d125\"><strong>2.<\/strong>&nbsp;Enable the following services:<\/p>\n\n\n\n<p id=\"fdda\"><strong><em>a. Kubernetes Engine API<br>b. Cloud Build API<br>c. Container Registry API<br>d. loud Source Repositories API<\/em><\/strong><\/p>\n\n\n\n<p id=\"3755\">Below are the steps for enabling above services.<\/p>\n\n\n\n<ul>\n<li>Go to the Google Cloud Console and select your project.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*4EHLDxsGw4Wk8jdyedTIuw.png\" alt=\"\"\/><\/figure>\n\n\n\n<ul>\n<li>In the navigation menu, go to APIs &amp; Services &gt; Dashboard.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*2JKhuUYYo_5kTyVFhjIuFA.png\" alt=\"\"\/><\/figure>\n\n\n\n<ul>\n<li>Click on \u201c+ ENABLE APIS AND SERVICES\u201d.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*-MOTg5DPxjQgFLM3JH_0qg.png\" alt=\"\"\/><\/figure>\n\n\n\n<ul>\n<li>In the search bar, type \u201cKubernetes Engine API\u201d and select it from the list of available APIs.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*TVZDukiPkSKjZ2GONZRn6g.png\" alt=\"\"\/><\/figure>\n\n\n\n<ul>\n<li>Click the \u201cENABLE\u201d button.<\/li>\n\n\n\n<li>Repeat steps for Cloud Build API, Container Registry API, and Cloud Source Repositories API, respectively.<\/li>\n<\/ul>\n\n\n\n<p id=\"f6d7\"><strong>3.<\/strong>&nbsp;Create a new GKE cluster with default settings.<br>To create a new GKE cluster with default settings, follow these steps:<\/p>\n\n\n\n<ul>\n<li>Go to the Google Cloud Console and select your project.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*4EHLDxsGw4Wk8jdyedTIuw.png\" alt=\"\"\/><\/figure>\n\n\n\n<ul>\n<li>In the navigation menu, go to Kubernetes Engine &gt; Clusters.<\/li>\n\n\n\n<li>Click the \u201c+ CREATE CLUSTER\u201d button.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*YK942y1umQmqRe_7NSGYYg.png\" alt=\"\"\/><\/figure>\n\n\n\n<ul>\n<li>In the \u201cCreate a cluster\u201d dialog, enter a name for your new cluster.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*vnZhOwBv4Kl8SC3bgj9Tqw.png\" alt=\"\"\/><\/figure>\n\n\n\n<ul>\n<li>Leave the default settings for the cluster size, node pool settings, and other advanced options.<\/li>\n\n\n\n<li>Click the \u201cCREATE\u201d button to create your new cluster.<\/li>\n<\/ul>\n\n\n\n<p id=\"f666\"><strong>4.&nbsp;<\/strong>Create a new GitHub repository to store your microservice code.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"fe70\">Creating the Microservice<\/h3>\n\n\n\n<p id=\"0867\">We will create a simple Java microservice that exposes a REST API endpoint. Follow the steps below to create the microservice:<\/p>\n\n\n\n<p id=\"0dd3\"><strong>1.<\/strong>&nbsp;Create a new Spring Boot project using the Spring initializr.<\/p>\n\n\n\n<p id=\"604b\"><strong>2.<\/strong>&nbsp;Add the following dependencies to the&nbsp;<code>pom.xml<\/code>&nbsp;file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;dependency&gt;\n    &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n    &lt;artifactId&gt;spring-boot-starter-web&lt;\/artifactId&gt;\n&lt;\/dependency&gt;\n&lt;dependency&gt;\n    &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n    &lt;artifactId&gt;spring-boot-starter-actuator&lt;\/artifactId&gt;\n&lt;\/dependency&gt;<\/code><\/pre>\n\n\n\n<p id=\"a683\"><strong>3.<\/strong>&nbsp;Create a new&nbsp;<code>HelloController<\/code>&nbsp;class with the following code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@RestController\npublic class HelloController {\n\n    @GetMapping(\"\/\")\n    public String sayHello() {\n        return \"Hello, World!\";\n    }\n}<\/code><\/pre>\n\n\n\n<p id=\"fb21\"><strong>4.&nbsp;<\/strong>Build and run the microservice using the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ mvn spring-boot:run<\/code><\/pre>\n\n\n\n<p id=\"912f\">You should be able to access the microservice at&nbsp;<code>http:\/\/localhost:8080<\/code><a href=\"http:\/\/localhost:8080.\/\" rel=\"noreferrer noopener\" target=\"_blank\">.<\/a><\/p>\n\n\n\n<p id=\"448d\"><strong>5.&nbsp;<\/strong>Create a&nbsp;<code>Dockerfile<\/code>&nbsp;in your microservice project directory with the following contents:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>FROM openjdk:8-jdk-alpine\nADD target\/my-microservice.jar my-microservice.jar\nENTRYPOINT &#91;\"java\", \"-jar\", \"\/my-microservice.jar\"]<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"a721\">Creating the Helm Chart<\/h3>\n\n\n\n<p id=\"5b46\">We will use Helm to package the microservice code into a deployable artifact called a chart. Follow the steps below to create the Helm chart:<\/p>\n\n\n\n<p id=\"e9fe\"><strong>1.<\/strong>&nbsp;Create a new Helm chart for the microservice using the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ helm chart create my-microservice<\/code><\/pre>\n\n\n\n<p id=\"9f9d\"><strong>2.&nbsp;<\/strong>Replace the contents of the&nbsp;<code>values.yaml<\/code>&nbsp;file with the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>image:\n  repository: gcr.io\/your-project-id\/my-microservice\n  tag: latest\n  pullPolicy: Always\n\nservice:\n  name: my-microservice\n  type: ClusterIP\n  port: 8080\n\ningress:\n  enabled: false<\/code><\/pre>\n\n\n\n<p id=\"edbb\">The&nbsp;<code>values.yaml<\/code>&nbsp;file contains the configuration values for the chart.<\/p>\n\n\n\n<p id=\"b84b\"><strong>3.<\/strong>&nbsp;Create a new&nbsp;<code>templates<\/code>&nbsp;directory in the chart directory.<\/p>\n\n\n\n<p id=\"b81f\"><strong>4.<\/strong>&nbsp;Create a new&nbsp;<code>deployment.yaml<\/code>&nbsp;file in the&nbsp;<code>templates<\/code>&nbsp;directory with the following contents:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apiVersion: apps\/v1\nkind: Deployment\nmetadata:\n  name: {{ .Chart.Name }}\n  labels:\n    app: {{ .Chart.Name }}\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      app: {{ .Chart.Name }}\n  template:\n    metadata:\n      labels:\n        app: {{ .Chart.Name }}\n    spec:\n      containers:\n        - name: {{ .Chart.Name }}\n          image: {{ .Values.image.repository }}:{{ .Values.image.tag }}\n          imagePullPolicy: {{ .Values.image.pullPolicy }}\n          ports:\n            - name: http\n              containerPort: {{ .Values.service.port }}\n          readinessProbe:\n            httpGet:\n              path: \/actuator\/health\n              port: http\n          livenessProbe:\n            httpGet:\n              path: \/actuator\/health\n              port: http<\/code><\/pre>\n\n\n\n<p id=\"18a6\">The&nbsp;<code>deployment.yaml<\/code>&nbsp;file describes the Kubernetes deployment that will run the microservice.<\/p>\n\n\n\n<p id=\"cbb2\"><strong>5.<\/strong>&nbsp;Create a new&nbsp;<code>service.yaml<\/code>&nbsp;file in the&nbsp;<code>templates<\/code>&nbsp;directory with the following contents:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apiVersion: v1\nkind: Service\nmetadata:\n  name: {{ .Chart.Name }}\n  labels:\n    app: {{ .Chart.Name }}\nspec:\n  type: {{ .Values.service.type }}\n  ports:\n    - name: http\n      port: {{ .Values.service.port }}\n      targetPort: http\n  selector:\n    app: {{ .Chart.Name }}<\/code><\/pre>\n\n\n\n<p id=\"e721\"><strong>6.&nbsp;<\/strong>Commit the Helm chart to your GitHub repository.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"bec3\">Setting up Cloud Build<\/h3>\n\n\n\n<p id=\"9f5e\">We will use Cloud Build to build and deploy the microservice to GKE. Follow the steps below to set up Cloud Build:<\/p>\n\n\n\n<p id=\"f4de\"><strong>1.<\/strong>&nbsp;Create a new&nbsp;<code>cloudbuild.yaml<\/code>&nbsp;file in the root of your GitHub repository with the following contents:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># cloudbuild.yaml\n\nsteps:\n  # Clone the repository\n  - name: 'gcr.io\/cloud-builders\/git'\n    args: &#91;'clone', 'https:\/\/github.com\/username\/repo.git']\n    dir: 'workspace'\n\n  # Step to build the Java JAR file\n  - name: 'gcr.io\/cloud-builders\/mvn'\n    args: &#91;'clean', 'install']\n    dir: 'workspace\/my-microservice'\n\n  # Check code quality with Checkstyle\n  - name: 'gcr.io\/cloud-builders\/mvn'\n    args: &#91;'checkstyle:checkstyle']\n    dir: 'workspace\/my-microservice'\n    \n  # Build the Docker image of the microservice\n  - name: 'gcr.io\/cloud-builders\/docker'\n    args: &#91;'build', '-t', 'gcr.io\/$PROJECT_ID\/my-microservice:$COMMIT_SHA', '.\/workspace\/my-microservice']\n    \n  # Push the Docker image to the container registry\n  - name: 'gcr.io\/cloud-builders\/docker'\n    args: &#91;'push', 'gcr.io\/$PROJECT_ID\/my-microservice:$COMMIT_SHA']\n      \n  # Set up kubectl\n  - name: gcr.io\/cloud-builders\/kubectl\n    id: Configure kubectl\n    args:\n      - cluster-info\n    env:\n      - 'PROJECT=my-project'\n      - 'CLOUDSDK_COMPUTE_REGION=us-central1-a'\n      - 'CLOUDSDK_CONTAINER_CLUSTER=my-cluster'\n      - KUBECONFIG=\/workspace\/.kube\/config     \n     \n  # Set up Helm and deploy the application\n  - name: 'gcr.io\/cloud-builders\/helm'\n    args:\n      - 'upgrade'\n      - '--install'\n      - 'my-microservice'\n      - '.\/my-microservice-chart'\n      - '--set=image.tag=$COMMIT_SHA'\n      - '--namespace=my-namespace'\n      - '--wait'\n    env:\n      - 'HELM_HOME=\/workspace'\n      - 'KUBECONFIG=\/workspace\/.kube\/config'\n      - 'CLOUDSDK_COMPUTE_ZONE=us-central1-a'\n      - 'CLOUDSDK_CONTAINER_CLUSTER=my-cluster'<\/code><\/pre>\n\n\n\n<p id=\"1bae\">The&nbsp;<code>cloudbuild.yaml<\/code>&nbsp;file describes the build steps for the microservice. In this configuration, Cloud Build performs the following steps:<\/p>\n\n\n\n<p id=\"6edc\"><strong>Step 1:<\/strong>&nbsp;Build the microservice using Maven.<br><strong>Step 2:<\/strong>&nbsp;Builds a Docker image and tags it with the&nbsp;<code>$COMMIT_SHA<\/code>&nbsp;value.<br><strong>Step 3:<\/strong>&nbsp;Pushes the Docker image to Container Registry.<br><strong>Step 4:<\/strong>&nbsp;Applies the Kubernetes service configuration<br><strong>Step 5:<\/strong>&nbsp;Deploy the Helm chart with the image tag set to&nbsp;<code>$SHORT_SHA<\/code>.<\/p>\n\n\n\n<p id=\"7739\">Note that we\u2019re using environment variables to pass project ID and commit SHA to the build steps.<\/p>\n\n\n\n<p id=\"0a7b\"><strong>2.<\/strong>&nbsp;Grant the Cloud Build service account the following roles:<\/p>\n\n\n\n<p id=\"1f30\"><strong>a.<\/strong>&nbsp;Kubernetes Engine Developer<br><strong>b.&nbsp;<\/strong>Storage Object Viewer<br><strong>c.<\/strong>&nbsp;Cloud Build Service Account<\/p>\n\n\n\n<p id=\"a846\">To grant the Cloud Build service account the necessary roles, follow these steps:<\/p>\n\n\n\n<ul>\n<li>Go to the Google Cloud Console and select your project.<\/li>\n\n\n\n<li>In the navigation menu, go to IAM &amp; Admin &gt; IAM.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*FkKRsD324j1ux78UfV_TMA.png\" alt=\"\"\/><\/figure>\n\n\n\n<ul>\n<li>Enter the email address of the Cloud Build service account: [PROJECT_NUMBER]@cloudbuild.gserviceaccount.com<\/li>\n\n\n\n<li>Note: Replace [PROJECT_NUMBER] with your project number.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*v5igFIbNv2437zzW13G47A.png\" alt=\"\"\/><\/figure>\n\n\n\n<ul>\n<li>Select \u201cKubernetes Engine Developer\u201d and required \u201cRole\u201d and enable it.<\/li>\n<\/ul>\n\n\n\n<p id=\"84eb\"><strong>3.<\/strong>&nbsp;Add a trigger to the Cloud Build configuration by following these steps:<\/p>\n\n\n\n<ul>\n<li>Go to the Cloud Build triggers page in the Cloud Console.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*TprY-ZXMlS098EVWXzWyYQ.png\" alt=\"\"\/><\/figure>\n\n\n\n<ul>\n<li>Click \u201cCreate Trigger\u201d.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*zv0G4Z1G7y4DkF_0wrhzCg.png\" alt=\"\"\/><\/figure>\n\n\n\n<ul>\n<li>Put the name of your cloud build pipeline.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*dRfnGgJsS_L0ZG_O4NOrCg.png\" alt=\"\"\/><\/figure>\n\n\n\n<ul>\n<li>Set the source to your GitHub repository and choose the branch to trigger on.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*Tc8NYzk0fyf0LZJmMKRnHA.png\" alt=\"\"\/><\/figure>\n\n\n\n<ul>\n<li>Set the trigger type to \u201cCloud Build configuration file\u201d.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*r45SDD6trVQPmXUq22w6ew.png\" alt=\"\"\/><\/figure>\n\n\n\n<ul>\n<li>Set the configuration file location to&nbsp;<code>cloudbuild.yaml<\/code>.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:1400\/1*AZvOPpJ9aydzixZtWLoOZQ.png\" alt=\"\"\/><\/figure>\n\n\n\n<ul>\n<li>Click \u201cCreate\u201d to save the trigger.<\/li>\n<\/ul>\n\n\n\n<p id=\"f36c\">With this trigger, Cloud Build will automatically build and deploy the microservice whenever changes are pushed to the specified branch.<\/p>\n\n\n\n<p id=\"80f2\">Note that you can customize the trigger settings to suit your needs, such as specifying build substitutions, triggering builds on specific files or directories, and setting build timeouts and logging options.<\/p>\n\n\n\n<p id=\"f015\">In this blog, we have walked through the process of deploying a Java microservice to Google Kubernetes Engine (GKE) using Helm and Cloud Build. We started by creating a new GKE cluster, configuring Helm, and creating a Helm chart for the microservice. We then set up Cloud Build to automatically build and deploy the microservice to GKE whenever changes are pushed to the specified branch. By following these steps, you should be able to deploy your own Java microservices to GKE with ease.<\/p>\n\n\n\n<p id=\"8d07\"><em>Happy deploying!&nbsp;<\/em>\ud83e\udd70<\/p>\n\n\n\t<div id=\"respond\" class=\"comment-respond wp-block-post-comments-form\">\n\t\t<h3 id=\"reply-title\" class=\"comment-reply-title\">Leave a Reply <small><a rel=\"nofollow\" id=\"cancel-comment-reply-link\" href=\"\/blog\/wp-json\/wp\/v2\/posts\/118#respond\" style=\"display:none;\">Cancel reply<\/a><\/small><\/h3><form action=\"https:\/\/cloudtechner.com\/blog\/wp-comments-post.php\" method=\"post\" id=\"commentform\" class=\"comment-form\"><p class=\"comment-notes\"><span id=\"email-notes\">Your email address will not be published.<\/span> <span class=\"required-field-message\">Required fields are marked <span class=\"required\">*<\/span><\/span><\/p><p class=\"comment-form-comment\"><label for=\"comment\">Comment <span class=\"required\">*<\/span><\/label> <textarea id=\"comment\" name=\"comment\" cols=\"45\" rows=\"8\" maxlength=\"65525\" required=\"required\"><\/textarea><\/p><p class=\"comment-form-author\"><label for=\"author\">Name <span class=\"required\">*<\/span><\/label> <input id=\"author\" name=\"author\" type=\"text\" value=\"\" size=\"30\" maxlength=\"245\" autocomplete=\"name\" required=\"required\" \/><\/p>\n<p class=\"comment-form-email\"><label for=\"email\">Email <span class=\"required\">*<\/span><\/label> <input id=\"email\" name=\"email\" type=\"text\" value=\"\" size=\"30\" maxlength=\"100\" aria-describedby=\"email-notes\" autocomplete=\"email\" required=\"required\" \/><\/p>\n<p class=\"comment-form-url\"><label for=\"url\">Website<\/label> <input id=\"url\" name=\"url\" type=\"text\" value=\"\" size=\"30\" maxlength=\"200\" autocomplete=\"url\" \/><\/p>\n<p class=\"comment-form-cookies-consent\"><input id=\"wp-comment-cookies-consent\" name=\"wp-comment-cookies-consent\" type=\"checkbox\" value=\"yes\" \/> <label for=\"wp-comment-cookies-consent\">Save my name, email, and website in this browser for the next time I comment.<\/label><\/p>\n<p class=\"form-submit\"><span class=\"bloghash-submit-form-button\"><input name=\"submit\" type=\"submit\" id=\"submit\" class=\"submit\" value=\"Post Comment\" \/><\/span> <input type='hidden' name='comment_post_ID' value='118' id='comment_post_ID' \/>\n<input type='hidden' name='comment_parent' id='comment_parent' value='0' \/>\n<\/p><\/form>\t<\/div><!-- #respond -->\n\t","protected":false},"excerpt":{"rendered":"<p>Author : Pankaj Singh Holariya, Senior Engineer &#8211; CloudDevOps Original Published Date: May 31, 2023 Are you looking to simplify the deployment process of microservices architecture in Google Kubernetes Engine&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,36,23,21,32,35,71],"tags":[10,82,39,78,79,80,81,27,31],"_links":{"self":[{"href":"https:\/\/cloudtechner.com\/blog\/wp-json\/wp\/v2\/posts\/118"}],"collection":[{"href":"https:\/\/cloudtechner.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudtechner.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudtechner.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudtechner.com\/blog\/wp-json\/wp\/v2\/comments?post=118"}],"version-history":[{"count":2,"href":"https:\/\/cloudtechner.com\/blog\/wp-json\/wp\/v2\/posts\/118\/revisions"}],"predecessor-version":[{"id":126,"href":"https:\/\/cloudtechner.com\/blog\/wp-json\/wp\/v2\/posts\/118\/revisions\/126"}],"wp:attachment":[{"href":"https:\/\/cloudtechner.com\/blog\/wp-json\/wp\/v2\/media?parent=118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudtechner.com\/blog\/wp-json\/wp\/v2\/categories?post=118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudtechner.com\/blog\/wp-json\/wp\/v2\/tags?post=118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}