<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Google Cloud Archives - Codersee blog- Kotlin on the backend</title>
	<atom:link href="https://blog.codersee.com/tag/google-cloud/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>Kotlin &#38; Backend Tutorials - Learn Through Practice.</description>
	<lastBuildDate>Wed, 16 Apr 2025 04:50:30 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://blog.codersee.com/wp-content/uploads/2025/04/cropped-codersee_logo_circle_2-32x32.png</url>
	<title>Google Cloud Archives - Codersee blog- Kotlin on the backend</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Spring Boot on Google GKE with Cloud SQL and Kotlin</title>
		<link>https://blog.codersee.com/spring-boot-on-google-gke-with-cloud-sql-and-kotlin/</link>
					<comments>https://blog.codersee.com/spring-boot-on-google-gke-with-cloud-sql-and-kotlin/#comments</comments>
		
		<dc:creator><![CDATA[Piotr]]></dc:creator>
		<pubDate>Thu, 15 Oct 2020 09:50:39 +0000</pubDate>
				<category><![CDATA[Spring]]></category>
		<category><![CDATA[Cloud SQL]]></category>
		<category><![CDATA[Google Cloud]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Spring Boot]]></category>
		<guid isPermaLink="false">http://codersee.com/?p=1495</guid>

					<description><![CDATA[<p>In this article, I'd like to show you how to deploy Spring Boot Kotlin application to the GKE with Cloud SQL using sidecar pattern.</p>
<p>The post <a href="https://blog.codersee.com/spring-boot-on-google-gke-with-cloud-sql-and-kotlin/">Spring Boot on Google GKE with Cloud SQL and Kotlin</a> appeared first on <a href="https://blog.codersee.com">Codersee blog- Kotlin on the backend</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2 class="article-heading-introduction">1. Introduction</h2>
<p>In <a href="http://codersee.com/deploy-spring-boot-application-to-gke/" target="_blank" rel="noopener noreferrer">one of my past articles</a>, we&#8217;ve learned how to deploy the <strong>Spring Boot Kotlin</strong> application to the <strong>Google Kubernetes Engine</strong>. According to your feedback, you really enjoyed it and some of you asked me to write something more about connecting to the databases in such an environment.</p>
<p>In the beginning, I&#8217;d like to thank you so much for the inspiration. You can be sure, that in the future I will prepare more articles on this topic.</p>
<p>In this guide, I&#8217;d like to show you how to deploy <strong>Spring Boot Kotlin</strong> application to the <strong>GKE with Cloud SQL</strong> using a sidecar pattern. It will be the continuation of <a href="http://codersee.com/deploy-spring-boot-application-to-gke/" target="_blank" rel="noopener noreferrer">this post</a>, so I highly recommend spending some time checking it.</p>
<h2 class="article-heading-main">2. Create Cloud SQL Instance</h2>
<p>As the first step, let&#8217;s head to the <a href="https://console.cloud.google.com/sql/" target="_blank" rel="noopener noreferrer">GCP Cloud SQL console</a> and click the <strong>Create Instance</strong> button.</p>
<p><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-1514" src="http://blog.codersee.com/wp-content/uploads/2020/10/1-1.png" alt="This image cotnains the screenshot from cloud sql create instance page" width="537" height="301" srcset="https://blog.codersee.com/wp-content/uploads/2020/10/1-1.png 537w, https://blog.codersee.com/wp-content/uploads/2020/10/1-1-300x168.png 300w" sizes="(max-width: 537px) 100vw, 537px" /></p>
<p>On the next page, let&#8217;s select the <strong>MySQL database</strong>:</p>
<p><img decoding="async" class="alignnone size-full wp-image-1515" src="http://blog.codersee.com/wp-content/uploads/2020/10/2-1.png" alt="Photo shows the screenshot from cloud sql select database page" width="483" height="315" srcset="https://blog.codersee.com/wp-content/uploads/2020/10/2-1.png 483w, https://blog.codersee.com/wp-content/uploads/2020/10/2-1-300x196.png 300w" sizes="(max-width: 483px) 100vw, 483px" /></p>
<p>Let&#8217;s provide the <em>instance ID</em> and<em> root password</em> for our database. As you can see on the below screenshot, we can also specify other things, like <em>region</em>, <em>zone</em>, or <em>database</em> version:</p>
<p><img decoding="async" class="alignnone size-full wp-image-1516" src="http://blog.codersee.com/wp-content/uploads/2020/10/3-3.png" alt="The photo shows the screenshot from configure instance info page" width="462" height="515" srcset="https://blog.codersee.com/wp-content/uploads/2020/10/3-3.png 462w, https://blog.codersee.com/wp-content/uploads/2020/10/3-3-269x300.png 269w" sizes="(max-width: 462px) 100vw, 462px" /></p>
<p>Finally, let&#8217;s click the <strong>Create</strong> button and start the process of creating the instance.</p>
<h2 class="article-heading-main">3. Create a Service Account</h2>
<p>As the next step, let&#8217;s switch to the <a href="https://console.cloud.google.com/iam-admin/serviceaccounts" target="_blank" rel="noopener noreferrer">service accounts panel</a> of the IAM management. We need to prepare the service account, which will be used later to establish the connection between the <strong>GKE</strong> and <strong>Cloud SQL</strong>.</p>
<p>Let&#8217;s click the <strong>Create Service Account</strong> button. Then, let&#8217;s specify the service account name and click <strong>Create</strong>:</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1517" src="http://blog.codersee.com/wp-content/uploads/2020/10/5-1.png" alt="The image contains the screenshot showing how to provide the service account name for the cloud sql service account" width="620" height="426" srcset="https://blog.codersee.com/wp-content/uploads/2020/10/5-1.png 620w, https://blog.codersee.com/wp-content/uploads/2020/10/5-1-300x206.png 300w" sizes="auto, (max-width: 620px) 100vw, 620px" /></p>
<p>Nextly, let&#8217;s grant the <em><strong>Cloud SQL Admin Role</strong></em> to our service account:</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1518" src="http://blog.codersee.com/wp-content/uploads/2020/10/6-1.png" alt="The image shows the screenshot from the console showing how to add Cloud SQL Admin role to the service account" width="533" height="313" srcset="https://blog.codersee.com/wp-content/uploads/2020/10/6-1.png 533w, https://blog.codersee.com/wp-content/uploads/2020/10/6-1-300x176.png 300w" sizes="auto, (max-width: 533px) 100vw, 533px" /></p>
<p>Please note: for the tutorial, we are using the admin role, but in the real-life scenarios we should always remember about the <strong>Principle of Least Privilege (POLP)</strong>.</p>
<h2 class="article-heading-main">4. Enable Cloud SQL Admin API</h2>
<p>Before we will be able to connect using the Cloud SQL Proxy, we need to enable the Cloud SQL Admin API. To do that, let&#8217;s head to the <a href="https://console.developers.google.com/apis/library/sqladmin.googleapis.com" target="_blank" rel="noopener noreferrer">API management page</a> and click the Enable button:</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1520" src="http://blog.codersee.com/wp-content/uploads/2020/10/api-enable.png" alt="The image shows how to enable the Cloud SQL Admin API" width="515" height="256" srcset="https://blog.codersee.com/wp-content/uploads/2020/10/api-enable.png 515w, https://blog.codersee.com/wp-content/uploads/2020/10/api-enable-300x149.png 300w" sizes="auto, (max-width: 515px) 100vw, 515px" /></p>
<h2 class="article-heading-main">5. Connecting Using the Cloud SQL Proxy</h2>
<p>There are a few approaches on how to connect to our SQL instance. For a better understanding of the topic, I highly recommend checking out <a href="https://cloud.google.com/sql/docs/mysql/connect-kubernetes-engine" target="_blank" rel="noopener noreferrer">this Google guide</a>.</p>
<p>In this tutorial, we will add the proxy to our application&#8217;s pod using the <em>sidecar container pattern</em>. If you would be interested in tutorials covering other ways of connection, please let me know about it.</p>
<h3 class="article-heading-sub">5.1. Add Proxy Container</h3>
<p>Let&#8217;s start by adding the proxy to the deployment file. Let&#8217;s head to the previously created <strong>deployment.yaml</strong> file and put the following config under the <em><strong>containers</strong></em>:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="yaml">- image: gcr.io/cloudsql-docker/gce-proxy:1.18.0
  name: cloud-sql-proxy
  command:
    - "/cloud_sql_proxy"
    - "-instances=&lt;PROJECT_ID&gt;:&lt;ZONE&gt;:&lt;INSTANCE_NAME&gt;=tcp:3306"
  securityContext:
    runAsNonRoot: true
</pre>
<p>The second command in our configuration requires us to specify the list of comma-separated fully qualified instances connections names. You can check your connection name in the <a href="https://console.cloud.google.com/sql/" target="_blank" rel="noopener noreferrer">Cloud SQL console</a>.</p>
<h3 class="article-heading-sub">5.2. Connect Service Account</h3>
<p>As the next step, we will provide the service account for our proxy. We will do it using <strong>GKE&#8217;s Workload Identity feature</strong>, which is the preferred method. To put it simply, we will bind the <strong>Kubernetes Service Account (KSA)</strong> to a <strong>Google Service Account (GSA)</strong>.</p>
<p>Let&#8217;s start by enabling the Workload Identity on our existing cluster:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="raw">gcloud container clusters update  \
  --workload-pool=&lt;PROJECT-ID&gt;.svc.id.goog
  --zone=&lt;ZONE&gt;
</pre>
<p>We will need to wait for some time for the changes to be applied.</p>
<p>Nextly, let&#8217;s create the <strong>service-account.yaml</strong> file and put there the configuration for the KSA:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="yaml">apiVersion: v1
kind: ServiceAccount
metadata:
  name: cloud-sql-sa
</pre>
<p>And create the KSA in our cluster:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="raw">kubectl apply -f service-account.yaml</pre>
<p>With that being done, we can enable the IAM binding between the<strong> &lt;GSA-NAME&gt;</strong> and<strong> &lt;KSA-NAME&gt;</strong>:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="raw">gcloud iam service-accounts add-iam-policy-binding \
  --role roles/iam.workloadIdentityUser \
  --member "serviceAccount:&lt;PROJECT-ID&gt;.svc.id.goog[&lt;K8S-NAMESPACE&gt;/&lt;KSA-NAME&gt;]" \
  &lt;GSA-NAME&gt;@&lt;PROJECT-ID&gt;.iam.gserviceaccount.com
</pre>
<p>As the next step, let&#8217;s add an annotation to <strong>&lt;KSA-NAME&gt;</strong> to complete the binding:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="raw">kubectl annotate serviceaccount \
   &lt;KSA-NAME&gt; \
   iam.gke.io/gcp-service-account=&lt;GSA-NAME&gt;@&lt;PROJECT-ID&gt;.iam.gserviceaccount.com
</pre>
<p>Finally, please make sure to specify the service account for the Kubernetes object:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="yaml">spec:
  serviceAccountName: cloud-sql-sa
</pre>
<h2 class="article-heading-main">6. Configure Spring Boot App</h2>
<p>After all the above steps, we can finally switch to our <strong>Spring Boot</strong> project to set up the connection.</p>
<h3 class="article-heading-sub">6.1. Imports</h3>
<p>Let&#8217;s start by adding necessary imports:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="yaml">    runtimeOnly("mysql:mysql-connector-java")
</pre>
<p>As you can see, we are adding <strong>MySQL Connector dependency</strong>. If we had chosen another database in step 2, we would have to import the appropriate driver here.</p>
<h3 class="article-heading-sub">6.2. Edit Application Properties</h3>
<p>As the next step, let&#8217;s edit the <strong>application.yaml</strong> file and put the following configuration there:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="yaml">spring:
  datasource:
    url: jdbc:mysql://127.0.0.1:3306/${DB_NAME}
    username: ${DB_USERNAME}
    password: ${DB_PASSWORD}
</pre>
<p>Please notice, that the environment variables should be set to, or replaced with the correct values. For the learning purposes, as the user, we can use root with the password we&#8217;ve set in step 2. Also, to create the database, we can head to the <a href="https://console.cloud.google.com/sql/instances/mysql-instance1/databases" target="_blank" rel="noopener noreferrer">Cloud SQL Databases console</a>.</p>
<h2 class="article-heading-main">7. Deploy Spring Boot App to GKE</h2>
<p>As the last step, let&#8217;s deploy our application to the<strong> Google Kubernetes Engine</strong>. Let&#8217;s build and push our container with the following commands:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="raw">docker build -t spring-boot-example .
docker tag spring-boot-example gcr.io//spring-boot-example:0.0.2
docker push gcr.io//spring-boot-example:0.0.2
</pre>
<p>Please notice, that you can use the tag whatever you like. I&#8217;m just using <em><strong>0.0.2</strong></em> to keep it concise with the previous article.</p>
<p>Finally, let&#8217;s update our deployment file:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="yaml">containers:
  - image: gcr.io//spring-boot-example:0.0.2
</pre>
<p>And submit our changes to the cluster:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="raw">kubectl apply -f deployment.yaml</pre>
<p>After all, we can check the status of changes, for instance with the get pods command:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="raw">kubectl get pods

//example response
NAME                                   READY   STATUS    RESTARTS   AGE
spring-boot-example-799bb5dd97-whwdb   2/2     Running   0          55s
</pre>
<p>As you can see, the Pod is running and both containers are ready.</p>
<h2 class="article-heading-main">8. Summary</h2>
<p>And that would be all for this article. We&#8217;ve covered step by step how to deploy the <strong>Spring Boot application</strong> to the<strong> Google Kubernetes Engine</strong> with <strong>Cloud SQL</strong>. I believe, that some of the steps may seem pretty difficult, but I can guarantee you that over time, you will get a much better understanding of this topic.</p>
<p>Hope you had a great time reading this article. Please remember, that you can always contact me through the <a href="https://www.facebook.com/codersee/" target="_blank" rel="noopener noreferrer"><strong>fan page</strong></a>, <a href="https://www.facebook.com/groups/622361565094117" target="_blank" rel="noopener noreferrer"><strong>group</strong></a>, or <strong><a href="http://codersee.com/contact/" target="_blank" rel="noopener noreferrer">contact</a> </strong>form. Don&#8217;t be afraid to ask any questions- I will be more than happy to answer them.</p>
<p>And of course, you can find the full source code <a href="https://github.com/codersee-blog/kotlin-spring-boot-gke-cloud-sql" target="_blank" rel="noopener noreferrer"><strong>here</strong></a>.</p>
<p>The post <a href="https://blog.codersee.com/spring-boot-on-google-gke-with-cloud-sql-and-kotlin/">Spring Boot on Google GKE with Cloud SQL and Kotlin</a> appeared first on <a href="https://blog.codersee.com">Codersee blog- Kotlin on the backend</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.codersee.com/spring-boot-on-google-gke-with-cloud-sql-and-kotlin/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Google Cloud Pub/Sub with Spring Boot and Java</title>
		<link>https://blog.codersee.com/google-cloud-pub-sub-with-spring-boot-and-java/</link>
					<comments>https://blog.codersee.com/google-cloud-pub-sub-with-spring-boot-and-java/#comments</comments>
		
		<dc:creator><![CDATA[Piotr]]></dc:creator>
		<pubDate>Thu, 08 Oct 2020 09:40:34 +0000</pubDate>
				<category><![CDATA[Spring]]></category>
		<category><![CDATA[Google Cloud]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Spring Boot]]></category>
		<guid isPermaLink="false">http://codersee.com/?p=1427</guid>

					<description><![CDATA[<p>In this step by step guide, we will learn how to set up Google Cloud Pub/Sub with Spring Boot Java application and Jackson JSON.</p>
<p>The post <a href="https://blog.codersee.com/google-cloud-pub-sub-with-spring-boot-and-java/">Google Cloud Pub/Sub with Spring Boot and Java</a> appeared first on <a href="https://blog.codersee.com">Codersee blog- Kotlin on the backend</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2 class="article-heading-introduction">1. Introduction</h2>
<p><a href="https://cloud.google.com/pubsub" target="_blank" rel="noopener noreferrer">Google Cloud Pub/Sub</a> might be a great tool to integrate decoupled systems hosted on <strong>GCP</strong> as well as elsewhere on the Internet. In this step-by-step guide, we will learn how to set up <strong>Google Cloud Pub/Sub with Spring Boot Java</strong> application.</p>
<p>Moreover, I will show you how to configure it for serialization and deserialization of <strong>POJOs</strong> using <strong>Jackson JSON</strong>.</p>
<h2 class="article-heading-introduction">2. Setup Google Cloud Project</h2>
<h3 class="article-heading-sub">2.1. Create Topic and Subscription</h3>
<p>As the first step, let&#8217;s go to the <a href="https://console.cloud.google.com/cloudpubsub" target="_blank" rel="noopener noreferrer">GCP console</a>, and let&#8217;s enable the <strong>Pub/Sub API</strong> for our future Spring Boot project by clicking the <em><strong>Enable</strong></em> button.</p>
<p>Alternatively, we can do the same with a <strong>gcloud CLI</strong> command:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="raw">gcloud services enable pubsub.googleapis.com
</pre>
<p>As the next step, let&#8217;s go to the <strong>Topics</strong> tab in the left sidebar and create a new topic named <em><strong>example</strong></em>:</p>
<p><img loading="lazy" decoding="async" class="post-image wp-image-1428 size-medium aligncenter" src="https://blog.codersee.com/wp-content/uploads/2020/10/1.png" alt="The image contains a screenshot from Google Cloud Platform console showing how to create a topic, which we will use to integrate pub/sub with Spring Boot Kotlin application later." width="503" height="333" /><br />
Or again, with a<strong> gcloud command</strong>:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="raw">gcloud pubsub topics create example</pre>
<p>Nextly, let&#8217;s go to the <strong>Subscriptions</strong> tab and click the <em><strong>create subscription</strong></em> button.</p>
<p>On this page, we can specify the subscription ID. Let&#8217;s call it an <em><strong>example-subscription</strong></em> and choose our previously created topic:</p>
<p><img loading="lazy" decoding="async" class="post-image aligncenter wp-image-1429 size-medium" src="http://blog.codersee.com/wp-content/uploads/2020/10/2.png" alt="The image contains a screenshot from Google Cloud Platform console showing how to create a subscription for a Cloud Pub/Sub topic" width="585" height="262" srcset="https://blog.codersee.com/wp-content/uploads/2020/10/2.png 585w, https://blog.codersee.com/wp-content/uploads/2020/10/2-300x134.png 300w" sizes="auto, (max-width: 585px) 100vw, 585px" /></p>
<p>Or, as usual, it can be done using <strong>CLI command</strong>:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="raw">gcloud pubsub subscriptions create example-subscription --topic=example</pre>
<p>If we would like to validate whether everything has been created, we can check it with these two commands:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="raw">gcloud pubsub subscriptions describe example-subscription
gcloud pubsub topics describe example
</pre>
<h3 class="article-heading-sub">2.2. Setup Service Account</h3>
<p>In this paragraph, we will learn how to create a service account, which will be used later in our <strong>Spring Boot</strong> project.</p>
<p>As the first step, let&#8217;s go to the <strong>GCP IAM &amp; Admin</strong> console and select the <a href="https://console.cloud.google.com/iam-admin/serviceaccounts" target="_blank" rel="noopener noreferrer">Service Accounts tab.</a> Then, let&#8217;s click the create service account button and specify the name as follows:<br />
<img loading="lazy" decoding="async" class="post-image size-medium wp-image-1434 aligncenter" src="http://blog.codersee.com/wp-content/uploads/2020/10/3-2.png" alt="The image contains a screenshot from Google Cloud Platform console showing how to create a service account" width="679" height="464" srcset="https://blog.codersee.com/wp-content/uploads/2020/10/3-2.png 679w, https://blog.codersee.com/wp-content/uploads/2020/10/3-2-300x205.png 300w" sizes="auto, (max-width: 679px) 100vw, 679px" /></p>
<p>&nbsp;</p>
<p>Nextly, we need to click continue, and on the next page, let&#8217;s add <em>Pub/Sub Admin</em> role:</p>
<p><img loading="lazy" decoding="async" class="post-image aligncenter wp-image-1431 size-medium" src="http://blog.codersee.com/wp-content/uploads/2020/10/4-300x183.png" alt="The image contains a screenshot from Google Cloud Platform console showing how to add the Pub/Sub admin role to the service account" width="300" height="183" srcset="https://blog.codersee.com/wp-content/uploads/2020/10/4-300x183.png 300w, https://blog.codersee.com/wp-content/uploads/2020/10/4.png 718w" sizes="auto, (max-width: 300px) 100vw, 300px" /></p>
<p>After the role has been added, we need to click next and finally click done. We will be redirected to the page showing all service accounts in our project. Let&#8217;s click the three dots near to the recently created Pub/Sub service account and click<em> <strong>Create key</strong></em>:</p>
<p><img loading="lazy" decoding="async" class="post-image alignnone wp-image-1432" src="http://blog.codersee.com/wp-content/uploads/2020/10/5.png" alt="The image contains a screenshot from Google Cloud Platform console showing how to create a key" width="1055" height="152" srcset="https://blog.codersee.com/wp-content/uploads/2020/10/5.png 1338w, https://blog.codersee.com/wp-content/uploads/2020/10/5-300x43.png 300w, https://blog.codersee.com/wp-content/uploads/2020/10/5-1024x148.png 1024w, https://blog.codersee.com/wp-content/uploads/2020/10/5-768x111.png 768w" sizes="auto, (max-width: 1055px) 100vw, 1055px" /><br />
As the key type, let&#8217;s select the <strong>JSON</strong>:</p>
<p><img loading="lazy" decoding="async" class="post-image size-medium wp-image-1433 aligncenter" src="http://blog.codersee.com/wp-content/uploads/2020/10/6.png" alt="The image contains a screenshot from Google Cloud Platform console showing how to choose the JSON key" width="565" height="360" srcset="https://blog.codersee.com/wp-content/uploads/2020/10/6.png 565w, https://blog.codersee.com/wp-content/uploads/2020/10/6-300x191.png 300w" sizes="auto, (max-width: 565px) 100vw, 565px" /></p>
<p>&nbsp;</p>
<p>As the last step, please download the file and put it inside the <strong>resources</strong> directory of the <strong>Spring Boot project</strong>.</p>
<h2 class="article-heading-introduction">3. Imports</h2>
<p>If all the Pub/Sub steps above have been completed, we can switch to the<strong> Spring Boot project</strong>. Firstly, let&#8217;s import two dependencies we will need for our project to work:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="groovy">  
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.cloud:spring-cloud-gcp-starter-pubsub'
</pre>
<h2 class="article-heading-introduction">4. Configure Application Properties</h2>
<p>As the next step, let&#8217;s define the <strong>application.yaml</strong> file as follows:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="yaml"> 
pubsub-example:
  subscription:
    name: ${EXAMPLE_PUBSUB_SUBSCRIPTION}
  topic:
    name: ${EXAMPLE_PUBSUB_TOPIC}

spring:
  cloud:
    gcp:
      credentials:
        location: classpath:credentials.json
</pre>
<p>Please notice, the name of the <strong>JSON</strong> should match the name of <strong>the file that we&#8217;ve put inside the resources folder</strong>. Also, the environment variables describing subscription and topic should be set to the correct values, for example:</p>
<ul>
<li><em>EXAMPLE_PUBSUB_SUBSCRIPTION</em> -&gt; projects/[PROJECT-ID]/subscriptions/example-subscription</li>
<li><em>EXAMPLE_PUBSUB_TOPIC</em> -&gt; projects/[PROJECT-ID]/topics/example</li>
</ul>
<h2 class="article-heading-introduction">6. Create a POJO Class</h2>
<p>Our next step is to create a simple <strong>POJO</strong> class, which will be used for the serialization and deserialization of the messages sent through the <strong>Pub/Sub</strong>:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="java">  
public class MessageEntity {

    private final LocalDateTime timestamp;
    private final String message;
    
    //constructor, getters, setters
}
</pre>
<p>As you can see, it is a simple class containing the timestamp and the value of the message.</p>
<h2 class="article-heading-introduction">7. Set Up The Consumer</h2>
<p>Let&#8217;s start the work on the consumer part by creating the <strong>PubSubConsumer</strong> interface:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="java">  
public interface PubSubConsumer {

    String subscription();

    Class payloadType();

    Consumer&lt;ConvertedBasicAcknowledgeablePubsubMessage&gt; messageConsumer();
}
</pre>
<p>As you can see, this interface consists of three methods definitions:</p>
<ul>
<li><em>subscription</em> -&gt; returns the name of the subscription</li>
<li><em>payloadTyme</em> -&gt; returns the Class object representing the target type of the payload</li>
<li><em>messageConsumer</em> -&gt; returns the callback method triggered when new messages arrive</li>
</ul>
<p>Technically, we don&#8217;t need this interface, but with this approach, we will be able to add easily more consumers in the future.</p>
<p>Secondly, let&#8217;s create the <strong>ExampleCosumer</strong> class implementing the interface:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="java">  
@Component
public class ExampleConsumer implements PubSubConsumer {

    private static final Logger log = LoggerFactory.getLogger(ExampleConsumer.class);
    private final String subscriptionName;

    public ExampleConsumer(
        @Value("${pubsub-example.subscription.name}") String subscriptionName
    ) {
        this.subscriptionName = subscriptionName;
    }
}
</pre>
<p>As you might have noticed, our class contains two fields: a <em>logger</em> and a <em>subscriptionName</em> which will be bound with the value from our <strong>properties.yaml</strong> file.</p>
<p>Please remember, that our class implements <strong>PubSubConsumer, </strong>so as the next step we need to provide the definition for each method:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="java">  
@Override
public String subscription() {
    return subscriptionName;
}

@Override
public Class payloadType() {
    return MessageEntity.class;
}

@Override
public Consumer&lt;ConvertedBasicAcknowledgeablePubsubMessage&gt; messageConsumer() {
    return this::consume;
}
</pre>
<p>To keep our code more readable, let&#8217;s implement our consumer method as a separate function:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="java">  
private void consume(ConvertedBasicAcknowledgeablePubsubMessage message) {
    MessageEntity received = message.getPayload();

    log.info(
        "Received entity: [timestamp= {}, message= {}]",
        received.getTimestamp(),
        received.getMessage()
    );

    message.ack();
}
</pre>
<p>To put it simply, this method extracts the payload from the <strong>ConvertedBasicAcknowledgeablePubsubMessage</strong> object and logs the timestamp and the message at the INFO level. In the end, it asynchronously acknowledges the message.</p>
<p>As the next step, let&#8217;s create <strong>ExampleSubscriberConfig</strong> class and put the configuration for our subscriber there:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="java">  
@Configuration
public class ExampleSubscriberConfig {

    private static final Logger log = LoggerFactory.getLogger(ExampleSubscriberConfig.class);

    private final PubSubTemplate pubSubTemplate;
    private final PubSubConsumer exampleConsumer;

   //constructor
}
</pre>
<p>As you might have noticed, besides the logger and the <em>exampleConsumer</em>, we are injecting <em>pubsubTemplate</em>, which will be used for publishing to topics and consuming messages.</p>
<p>Let&#8217;s implement the method responsible for subscription:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="java">  
@EventListener(ApplicationReadyEvent.class)
public void subscribe() {
    log.info("Subscribing to {}", exampleConsumer.subscription());

    pubSubTemplate.subscribeAndConvert(
        exampleConsumer.subscription(),
        exampleConsumer.messageConsumer(),
        exampleConsumer.payloadType()
    );
}
</pre>
<p>The annotation  <em><strong>EventListener</strong></em> used with <strong>ApplicationReadyEvent</strong> indicates, that the method will be called when the application is ready to receive requests.</p>
<p>As the last step, we need to provide the bean definition for a converter using <strong>Jackson JSON</strong>:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="java">  
@Configuration
public class PubSubConfig {

    @Bean
    public JacksonPubSubMessageConverter jacksonPubSubMessageConverter(ObjectMapper objectMapper) {
        return new JacksonPubSubMessageConverter(objectMapper);
    }
}
</pre>
<p>With that being done, we are ready to receive the messages.</p>
<h2 class="article-heading-introduction">8. Set Up The Publisher</h2>
<p>Besides receiving the messages, it would be good to have the possibility to publish some. Let&#8217;s start the work on the publisher part by creating the <strong>ExamplePublisher</strong> class:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="java">  
@Component
public class ExamplePublisher {

    private final String topic;
    private final PubSubTemplate pubSubTemplate;

    public ExamplePublisher(
        @Value("${pubsub-example.topic.name}") String topic,
        PubSubTemplate pubSubTemplate) {
        this.topic = topic;
        this.pubSubTemplate = pubSubTemplate;
    }
}
</pre>
<p>As we can see, we need to inject the <strong>PubSubTemplate</strong> bean and the topic, which will be set to the value from the application properties.</p>
<p>Let&#8217;s add a publish method then. It will take the <strong>MessageEntity</strong> as the argument:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="java">  
public void publish(MessageEntity payload) {
    pubSubTemplate.publish(topic, payload);
}
</pre>
<p>As you might have noticed, this method uses the <em>publish</em> method to push the object to the specified Pub/Sub topic.</p>
<h2 class="article-heading-introduction">9. Create Example Controller</h2>
<p>And finally, we can implement the <strong>TestController</strong> class:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="java">  
@RestController
@RequestMapping("/api")
public class TestController {

    private final ExamplePublisher publisher;

    public TestController(ExamplePublisher publisher) {
        this.publisher = publisher;
    }

    @PostMapping("/topic")
    public void publish(@RequestBody String message) {
        MessageEntity entity = new MessageEntity(LocalDateTime.now(), message);
        publisher.publish(entity);
    }
}
</pre>
<p>It&#8217;s just a simple REST controller, which will be responding to the POST<em> /api/topic</em> calls and forwarding the message to the publisher.</p>
<h2 class="article-heading-introduction">10. Testing Using Curl</h2>
<p>Lastly, there is nothing else to do than just test our application with the following command:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="raw">  
curl -d 'Some message' localhost:8080/api/topic
</pre>
<p>After it executes, we should see a new entry in our application logs (and each time we call the endpoint as well).</p>
<h2 class="article-heading-main">9. GCP Pub/Sub With Spring Boot Conclusion</h2>
<p>And I believe, that&#8217;s all for today. In this step-by-step tutorial, we&#8217;ve learned how to publish and receive messages through the<strong> Google Cloud Pub/Sub</strong> using <strong>the Spring Boot Java </strong>application.</p>
<p>I hope that you&#8217;ve really enjoyed this guide. I would be forever grateful if you would like to share some feedback with me. Would you like to see more Java tutorials as well? Please, let me know about it using our <a href="https://www.facebook.com/codersee/" target="_blank" rel="noopener noreferrer"><strong>page</strong></a>, <a href="https://www.facebook.com/groups/622361565094117" target="_blank" rel="noopener noreferrer"><strong>group</strong></a>, or <strong><a href="https://codersee.com/contact/" target="_blank" rel="noopener noreferrer">contact</a> </strong>form.</p>
<p>For the source code of the project, please visit our project on <a href="https://github.com/codersee-blog/java-spring-boot-pubsub" target="_blank" rel="noopener noreferrer"><strong>GitHub</strong></a>.</p>
<p>The post <a href="https://blog.codersee.com/google-cloud-pub-sub-with-spring-boot-and-java/">Google Cloud Pub/Sub with Spring Boot and Java</a> appeared first on <a href="https://blog.codersee.com">Codersee blog- Kotlin on the backend</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.codersee.com/google-cloud-pub-sub-with-spring-boot-and-java/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Deploy Spring Boot application to GKE</title>
		<link>https://blog.codersee.com/deploy-spring-boot-application-to-gke/</link>
					<comments>https://blog.codersee.com/deploy-spring-boot-application-to-gke/#respond</comments>
		
		<dc:creator><![CDATA[Piotr]]></dc:creator>
		<pubDate>Thu, 01 Oct 2020 09:50:26 +0000</pubDate>
				<category><![CDATA[Spring]]></category>
		<category><![CDATA[Google Cloud]]></category>
		<category><![CDATA[Kubernetes]]></category>
		<category><![CDATA[Spring Boot]]></category>
		<guid isPermaLink="false">http://codersee.com/?p=1097</guid>

					<description><![CDATA[<p>In this tutorial, we'll see how to set up and deploy the sample Spring Boot application to Google Kubernetes Engine (GKE)</p>
<p>The post <a href="https://blog.codersee.com/deploy-spring-boot-application-to-gke/">Deploy Spring Boot application to GKE</a> appeared first on <a href="https://blog.codersee.com">Codersee blog- Kotlin on the backend</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2 class="article-heading-introduction">1. Introduction</h2>
<p>If you&#8217;ve been learning programming for some time you probably heard about <strong><a href="https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/" target="_blank" rel="noopener noreferrer">Kubernetes</a></strong> (also known as <strong>Kube</strong> or <strong>K8s</strong>). In simple words, Kubernetes is a system for automating loads of processes, like deployment, scaling, and management of containerized applications.</p>
<p>There is no doubt that the K8s can improve our productivity and make our application more stable. However, maintaining the whole system might become more difficult and time-consuming. Fortunately, we can find lots of cloud providers offering Kubernetes as a managed service, like:</p>
<ul>
<li>Google Kubernetes Engine <strong><a href="https://cloud.google.com/kubernetes-engine" target="_blank" rel="noopener noreferrer">(GKE)</a></strong>,</li>
<li>Azure Kubernetes Service <strong><a href="https://azure.microsoft.com/en-us/services/kubernetes-service/" target="_blank" rel="noopener noreferrer">(AKS)</a></strong>,</li>
<li>Amazon Elastic Container Service for Kubernetes <strong><a href="https://aws.amazon.com/eks/" target="_blank" rel="noopener noreferrer">(Amazon EKS)</a></strong></li>
</ul>
<p>Choosing a provider-managed solution transfers the responsibility for managing and provisioning the master node to the cloud provider allowing us to focus more on the development itself.</p>
<p>In this tutorial, we&#8217;ll see how to set up and deploy the sample <strong>Spring Boot</strong> application to <strong>Google Kubernetes Engine (GKE).</strong></p>
<h2 class="article-heading-main">2. Prerequisites</h2>
<p>To follow the tutorial you need the following prerequisites:</p>
<ul>
<li>kubectl (Kubernetes CLI to manage a cluster)</li>
<li>gcloud (CLI tool to create and manage Google Cloud resources)</li>
<li>Google Cloud Account (free $ 300 trial)</li>
</ul>
<h2 class="article-heading-main">3. Create TestController Class With Test Endpoint</h2>
<p>Let&#8217;s start with implementing the example <em><strong>TestController</strong></em> with <strong>getHelloMessage</strong> function:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="kotlin">@RestController
@RequestMapping("/api/hello")
class TestController {

    @GetMapping
    fun getHelloMessage() : ResponseEntity&lt;String&gt; = ResponseEntity.ok("Hello world!")
}
</pre>
<p>This is a very straightforward function responding to <em><strong>GET</strong></em> requests to <strong><em>/api/hello</em></strong> and returning &#8220;Hello world!&#8221; String as the response.</p>
<h2 class="article-heading-main">4. Create Dockerfile</h2>
<p>As the next step, let&#8217;s prepare the <strong>Dockerfile</strong> we will use to build the Docker image later:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="dockerfile">FROM openjdk
VOLUME /tmp
RUN mkdir /work
COPY . /work
WORKDIR /work
RUN /work/gradlew build
RUN mv /work/build/libs/*.jar /work/app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/work/app.jar"]
</pre>
<h2 class="article-heading-main">5. Build Docker Image</h2>
<p>Secondly, let&#8217;s build a Docker image using already prepared <strong>Dockerfile</strong>:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="raw">docker build -t spring-boot-example .
</pre>
<p>When the command finishes its execution we will be informed that the image has been built and tagged successfully. We can also type <strong><em>docker images</em></strong> in the terminal to list all top-level images:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="raw">docker images

## command output
REPOSITORY                                          TAG                 IMAGE ID            CREATED              SIZE
spring-boot-example                                 latest              52eaa2a8ef8c        About a minute ago   1.12GB
openjdk                                             latest              0cd6de5fdbee        About a minute ago   511MB
</pre>
<p>As can be seen, the <strong>spring-boot-example</strong> image has been created and the <strong>OpenJDK</strong> image has been pulled as well.</p>
<h2 class="article-heading-main">6. Push Docker Image to Container Registry</h2>
<p>As the next step, we will push the created image to the <strong>Google Container Registry</strong>. Before we will be able to do it, let&#8217;s make sure that we&#8217;ve got the container registry already <a href="https://cloud.google.com/container-registry/docs/pushing-and-pulling#before_you_begin">configured</a> and choose a correct hostname, which specifies the location where we will store the <a href="https://cloud.google.com/container-registry/docs/pushing-and-pulling#pushing_an_image_to_a_registry">image</a>.</p>
<p>Let&#8217;s start with tagging the local image with the registry name with the <strong><em>docker tag</em></strong> command:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="raw">docker tag spring-boot-example gcr.io/[PROJECT-ID]/spring-boot-example:0.0.1
</pre>
<p>Then, let&#8217;s push our image to the container registry:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="raw">docker push gcr.io/[PROJECT-ID]/spring-boot-example:0.0.1
</pre>
<p>Finally, when the command finishes its execution we can validate, whether the image has been uploaded successfully by listing Google Container Registry images:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="raw">gcloud container images list

## command output
NAME
gcr.io/[PROJECT-ID]/spring-boot-example
</pre>
<p>Please notice, that <strong>[PROJECT-ID]</strong> will be different depending on our project&#8217;s id.</p>
<h2 class="article-heading-main">7. Create a Cluster</h2>
<p>Finally, we can create a new Kubernetes cluster within <strong>Google Kubernetes Engine</strong>. In this tutorial, we will use the <a href="https://console.cloud.google.com/kubernetes/" target="_blank" rel="noopener noreferrer">cloud console</a> (we could also do that using <strong>gcloud CLI</strong>). Let&#8217;s navigate to the panel and start by clicking the <em><strong>&#8220;Create cluster&#8221;</strong></em> button. Secondly, let&#8217;s configure cluster basics, like name and location type:</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-1148" src="http://blog.codersee.com/wp-content/uploads/2020/09/post_4_2.png" alt="Image contains screenshot from Google Kubernetes Engine console page showing how to configure cluster basics, like name and location type" width="880" height="698" srcset="https://blog.codersee.com/wp-content/uploads/2020/09/post_4_2.png 880w, https://blog.codersee.com/wp-content/uploads/2020/09/post_4_2-300x238.png 300w, https://blog.codersee.com/wp-content/uploads/2020/09/post_4_2-768x609.png 768w" sizes="auto, (max-width: 880px) 100vw, 880px" /></p>
<p>Then, let&#8217;s navigate to the node pools&#8217; <strong>default-pool tab</strong> and set the number of nodes to <strong>1</strong> (this number will be bigger in the real scenarios, but for the educational purposes we do not need more):</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-1150" src="http://blog.codersee.com/wp-content/uploads/2020/09/post_4_4.png" alt="Image contains screenshot from Google Kubernetes Engine console page showing how to set the number of nodes" width="952" height="697" /></p>
<p>As the last step, let&#8217;s click the <strong>Nodes tab</strong>, choose our machine type and boot disk size and click the <strong>&#8220;Create&#8221;</strong> button at the bottom of the site:</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-1149" src="http://blog.codersee.com/wp-content/uploads/2020/09/post_4_3.png" alt="Image contains screenshot from Google Kubernetes Engine console page showing how to set machine type and boot disk size" width="864" height="809" /></p>
<p>Please notice, that it may take some time before the changes will take place.</p>
<h2 class="article-heading-main">8. Create Kubernetes Deployment and Service</h2>
<p>In order to run our application in the <strong>K8s environment</strong>, we will prepare two configuration files- one for the <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" target="_blank" rel="noopener noreferrer">Deployment</a> and one for the <a href="https://kubernetes.io/docs/concepts/services-networking/service/" target="_blank" rel="noopener noreferrer">Service</a>. In a nutshell, a <strong>Deployment</strong> is an object representing an application running on our cluster and a <strong>Service</strong> allows us to expose an application as a network service.</p>
<h3 class="article-heading-sub">8.1. Create Deployment</h3>
<p>Firstly, let&#8217;s create the <em><strong>deployment.yaml</strong></em> file containing the following configuration:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="yaml">apiVersion: apps/v1
kind: Deployment
metadata:
  name: spring-boot-example
  labels:
    app: spring-boot-example
spec:
  replicas: 1
  selector:
    matchLabels:
      app: spring-boot-example
  template:
    metadata:
      labels:
        app: spring-boot-example
    spec:
      containers:
        - image: gcr.io/[PROJECT-ID]/spring-boot-example:0.0.1
          name: spring-boot-example-container
          imagePullPolicy: Always
          ports:
            - containerPort: 8080
          readinessProbe:
            httpGet:
              port: 8080
              path: /api/status
            initialDelaySeconds: 5
            failureThreshold: 5
          livenessProbe:
            httpGet:
              port: 8080
              path: /api/status
            initialDelaySeconds: 5
            failureThreshold: 5
</pre>
<p>Please remember to replace <strong>[PROJECT-ID]</strong> with the correct value.</p>
<h3 class="article-heading-sub">8.2. Create Service</h3>
<p>Similarly, let&#8217;s create the <em><strong>service.yaml</strong></em> file containing service&#8217;s configuration:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="yaml">apiVersion: v1
kind: Service
metadata:
  name: spring-boot-example-svc
spec:
  ports:
    - port: 80
      targetPort: 8080
      protocol: TCP
      name: http
  selector:
    app: spring-boot-example
  type: LoadBalancer
</pre>
<p>And that’s all the configuration that we need to prepare in order to set up our Pods and Service.</p>
<h2 class="article-heading-main">10. Apply Deployment and Service</h2>
<h3 class="article-heading-sub">10.1. Configure Kubectl Context</h3>
<p>As one of the last steps we need to <strong>fetch the credentials</strong> of the running cluster and <strong>configure our kubectl context</strong>:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="raw">gcloud container clusters get-credentials [CLUSTER-NAME] --zone [CLUSTER-ZONE] --project [PROJECT-ID]

## command output
Fetching cluster endpoint and auth data.
kubeconfig entry generated for example-cluster.
</pre>
<p>Finally, let&#8217;s apply our configurations using the <a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#apply" target="_blank" rel="noopener noreferrer"><strong><em>apply</em></strong></a> command:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="raw">kubectl apply -f deployment.yaml
kubectl apply -f service.yaml
</pre>
<h2 class="article-heading-main">11. Verification</h2>
<h3 class="article-heading-sub">11.1. Verify K8s Pods and Service</h3>
<p>In order to check, whether the <strong>Pods</strong> have been created successfully let&#8217;s run kubectl <strong><em>get pods</em></strong> command:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="raw">kubectl get pods

## command output
NAME                                   READY   STATUS    RESTARTS   AGE
spring-boot-example-697976c749-klc64   1/1     Running   0          50s
</pre>
<p>As can be seen, all pods are ready and the status is <strong><em>Running</em></strong>, so we can check whether the service has been created and the external IP address has been assigned:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="raw">kubectl get svc

## command output
NAME                      TYPE           CLUSTER-IP   EXTERNAL-IP   PORT(S)        AGE
kubernetes                ClusterIP      10.0.0.1     &lt;none&gt;        443/TCP        10m
spring-boot-example-svc   LoadBalancer   10.0.4.57    34.69.49.59   80:31509/TCP   2m56s
</pre>
<h3 class="article-heading-sub">11.2. Verify Test Endpoint</h3>
<p>Finally, let&#8217;s check our test endpoint:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="raw">curl 34.69.49.59/api/hello
</pre>
<p>And we see that we <em>Hello world!</em> text is returned as the response, meaning that our application has been deployed successfully and exposed to the world.</p>
<h2 class="article-heading-main">12. Conclusion</h2>
<p>In this article, we&#8217;ve learned how to deploy the <strong>Spring Boot application to Google Kubernetes Engine (GKE)</strong>. We&#8217;ve covered how to containerize our application, build the image, push it to Google Container Registry, and finally deploy it to GKE.</p>
<p>For the source code, please visit our project on <a href="https://github.com/codersee-blog/kotlin-spring-boot-gke" target="_blank" rel="noopener noreferrer"><strong>GitHub</strong></a>.</p>
<p>If you are reading this paragraph, I want to know that I am more than happy that you decided to spend your time learning with Codersee and I hope that this article helped you to learn something new. If you have any ideas or comments that you would like to share with us, please let us know in the comments below, by our Facebook <a href="https://www.facebook.com/codersee/" target="_blank" rel="noopener noreferrer"><strong>page</strong></a> or <a href="https://www.facebook.com/groups/622361565094117" target="_blank" rel="noopener noreferrer"><strong>group</strong></a>, or by using our <strong><a href="http://codersee.com/contact/" target="_blank" rel="noopener noreferrer">contact</a> </strong>form.</p>
<p>The post <a href="https://blog.codersee.com/deploy-spring-boot-application-to-gke/">Deploy Spring Boot application to GKE</a> appeared first on <a href="https://blog.codersee.com">Codersee blog- Kotlin on the backend</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.codersee.com/deploy-spring-boot-application-to-gke/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 

Served from: blog.codersee.com @ 2026-05-13 14:26:51 by W3 Total Cache
-->