<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ziya Patel on Medium]]></title>
        <description><![CDATA[Stories by Ziya Patel on Medium]]></description>
        <link>https://medium.com/@ziyapatel?source=rss-31f3f7b1d4d8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*ZeRg1c0ECmK6cyTi</url>
            <title>Stories by Ziya Patel on Medium</title>
            <link>https://medium.com/@ziyapatel?source=rss-31f3f7b1d4d8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 04:16:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ziyapatel/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Deploying KONG Ingress Controller on GKE with Cloud SQL Postgres]]></title>
            <link>https://blog.searce.com/deploying-kong-ingress-controller-on-gke-with-cloud-sql-postgres-c7ca7ae255a2?source=rss-31f3f7b1d4d8------2</link>
            <guid isPermaLink="false">https://medium.com/p/c7ca7ae255a2</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[kong]]></category>
            <category><![CDATA[gke]]></category>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[ingresscontroller]]></category>
            <dc:creator><![CDATA[Ziya Patel]]></dc:creator>
            <pubDate>Mon, 07 Aug 2023 06:04:28 GMT</pubDate>
            <atom:updated>2023-08-08T07:19:23.484Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*TxVHtWNRx559QqOJ9LoEpQ.jpeg" /></figure><h3>Kong Ingress Controller</h3><p>The Kubernetes Ingress resource is quite limited and vague in its API design, lacking resources to accurately describe the intricacies of proxying. To overcome this issue, we can use various third party Ingress controller solutions. One such is “Kong” . It is highly scalable, secure and comes with 400+ plugins. You can also tweek the CRDs to basically achieve anything you can think of.</p><p>There are two ways to implement Kong API gateway.</p><ul><li>DB less Mode: Kong Gateway can operate without a database by utilizing in-memory storage for its entities. This mode, known as “DB-less,” allows the configuration of entities to be managed in a separate YAML or JSON configuration file using a declarative approach. This approach is not recommended for Production Environments but rather can be used to test out the product on lower environments.</li><li>Traditional Mode (with database): This approach uses a database to store all its configuration files.</li></ul><h3>Backstory</h3><p>For a recent project, I wanted to implement Kong on GKE within a separate namespace. However, during initial testing, I discovered that when Kong is downloaded using Helm with its default values.yaml, it runs a separate Pod for the Postgresql database. This setup is highly undesirable because running a database or stateful application in this manner results in data loss when the Pod terminates.</p><p>To address this issue, one solution is to deploy a Persistent Volume Claim (PVC) for the database. However, we already have Cloud SQL Postgresql available, which can serve as a persistent storage option for the Kong configuration files. By injecting the Postgresql credentials into the values.yaml and installing Kong using these credentials, we can ensure that the configuration data remains intact even if the Pod is terminated.</p><p>This approach allows for the utilization of Cloud SQL Postgresql, providing persistence and durability for the Kong application.</p><p>Let’s start with the demonstration.</p><p>Step 1 : Create a VPC</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*17Taqr7tjnPwJx7L" /></figure><p>Step 2 : Create a Private service connection for the created VPC. Private Service Connect is a capability of Google Cloud networking that allows consumers to access managed services privately from inside their VPC network. In our case the internal IP for the Cloud SQL instance will be picked from the range we allocate here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qxAxDdpZLE3U4TET" /></figure><p>Step 3 : Create a Cloud SQL Postgresql Instance. Make sure to select Internal IP and the VPC created which has the private service connection configured on it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BQltnt6A0Zc5CWx0" /></figure><p>Step 4 : Create a user for Kong and a database for Kong.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Iyw_w7YxfNAy5Gbh" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_KmHfxVpkhDwrXZ8" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3fwLbuqVs6R22LoF" /></figure><p>Step 5 : Once the database is created, connect to the cluster and create two namespaces. One that will have kong installed on it and other with the application. In this case, I have two namespaces, app and kong, app has a nginx web server running on it and kong will have the kong setup on it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_g9qT75zGhpmx9J-" /></figure><p>Step 6 : For installing kong, follow these steps :</p><blockquote>helm repo add kong <a href="https://charts.konghq.com/">https://charts.konghq.com</a> ; helm repo update</blockquote><blockquote>helm install kong kong/kong -n kong -f values.yaml</blockquote><p>I have added the values.yaml file below.</p><pre>image:<br>  repository: kong<br>  tag: &quot;3.1&quot;<br>env:<br>  prefix: /kong_prefix/<br>  database: postgres<br>  pg_host: &quot;&lt;ip-of-instance&gt;&quot;<br>  pg_database: &lt;name-of-the-database&gt;<br>  pg_user: &lt;name-of-the-user&gt;<br>  pg_password: &lt;password&gt;<br>  lua_package_path: /opt/?.lua;;<br>  pg_ssl: &quot;off&quot;<br>postgresql:<br>  enabled: false # It is disabled to operate kong in DB mode and make use of the Google managed PostgreSQL database</pre><p>Note: In an ideal production environment, it is recommended not to hardcode the database, its users, and their passwords. To address this concern, you can utilise an external secrets operator, which enhances Kubernetes’ security functionality.</p><p>Please follow this link to implement it in your environment — <a href="https://external-secrets.io/v0.8.5/introduction/getting-started/">https://external-secrets.io/v0.8.5/introduction/getting-started/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9xjIV0OAFrGKEMu7" /></figure><p>When you try to hit the LB you will see that the port is up, but nothing is directed on it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*crogWocGK0yeEuTA" /></figure><p>Step 7 : Deploy Nginx web server in the namespace “app”. Expose the Nginx web server as ClusterIP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*v4XG9sxXH8EJPqcq" /></figure><p>Step 8 : We will then go ahead and create an ingress resource file for the Nginx Web server App.</p><pre>apiVersion: networking.k8s.io/v1<br>kind: Ingress<br>metadata:<br>  name: kong-ing<br>spec:<br>  ingressClassName: kong<br>  rules:<br>  - http:<br>      paths:<br>      - path: /<br>        pathType: ImplementationSpecific<br>        backend:<br>          service:<br>            name: kong-svc<br>            port:<br>              number: 80</pre><p>Run this yaml in the Kong namespace where the Kong Ingress Controller is deployed.</p><pre>kind: Service<br>apiVersion: v1<br>metadata:<br>  name: kong-svc<br>  namespace: kong<br>spec:<br>  ports:<br>  - protocol: TCP<br>    port: 80<br> type: ExternalName<br> externalName: nginx.app.svc.cluster.local</pre><p>Here the externalName follows the &lt;name-of-the-app&gt;.&lt;namesapce&gt;.svc.cluster.local format.</p><p>Once you run the yaml, you can hit the external IP to validate that the Nginx Web app is being served via kong ingress Controller.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uWQQ8RdUTJKag0uI" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*M0puHyTKLWWaVSxN" /></figure><p>You can also login into the Postgresql instance to validate that all the configuration files and data is being saved.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*s9_afcOVKskZpE1f" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wb7xFTktiC3Ig8wT" /></figure><h3>Conclusion</h3><p>I trust that the blog provided you with a swift introduction to Kong and how to initiate its use on Google Cloud. If you have any queries regarding the topic, please feel free to raise them in the comment section. Additionally, you can connect with me on LinkedIn for further assistance. You can contact “<a href="https://www.linkedin.com/in/ziyapatel/">Ziya Patel</a>” by sending a direct message.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7ca7ae255a2" width="1" height="1" alt=""><hr><p><a href="https://blog.searce.com/deploying-kong-ingress-controller-on-gke-with-cloud-sql-postgres-c7ca7ae255a2">Deploying KONG Ingress Controller on GKE with Cloud SQL Postgres</a> was originally published in <a href="https://blog.searce.com/">Searce</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>