{"id":33998,"date":"2024-08-16T09:27:32","date_gmt":"2024-08-16T07:27:32","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/?p=33998"},"modified":"2024-08-16T09:27:32","modified_gmt":"2024-08-16T07:27:32","slug":"cloudnativepg-connecting-external-applications","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-connecting-external-applications\/","title":{"rendered":"CloudNativePG \u2013 Connecting external applications"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Now that we know how we can <a href=\"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-benchmarking\/\" target=\"_blank\" rel=\"noreferrer noopener\">benchmark a CloudNativePG<\/a> deployment, it is time to look at how we can connect external applications to the PostgreSQL cluster. Usually, applications run in the same Kubernetes cluster and can directly talk to our PostgreSQL deployment, but sometimes it is required to also connect with external applications or services. By default, this does not work, as nothing is exposed externally.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can easily check this by looking at the services we currently have:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1]; title: ; notranslate\" title=\"\">\nk8s@k8s1:~$ kubectl get services -n default\nNAME               TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)    AGE\nkubernetes         ClusterIP   10.96.0.1        &lt;none&gt;        443\/TCP    32d\nmy-pg-cluster-r    ClusterIP   10.107.190.52    &lt;none&gt;        5432\/TCP   8d\nmy-pg-cluster-ro   ClusterIP   10.109.169.21    &lt;none&gt;        5432\/TCP   8d\nmy-pg-cluster-rw   ClusterIP   10.103.171.191   &lt;none&gt;        5432\/TCP   8d\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">There are IP addresses and services for all pods in the cluster, but those addresses are only available inside the cluster. For the external IP addresses there is &#8220;&lt;none&gt;&#8221; for all of them. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before we make those services available externally, lets quickly check what they mean:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>my-pg-cluster-r: Connects to any of the nodes for read only operations<\/li>\n\n\n\n<li>my-pg-cluster-ro: Connects always to a read only replica (hot standby)<\/li>\n\n\n\n<li>my-pg-cluster-rw: Connects always to the primary node<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Whatever connects to the cluster, should us one of those services and never connect to a PostreSQL instance directly. The reason is, that those services are managed by the operator and you should rely on the internal Kubernetes DNS for connecting to the cluster services.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">What we need to expose the PostgreSQL cluster services is an <a href=\"https:\/\/kubernetes.io\/docs\/concepts\/services-networking\/ingress\/\" target=\"_blank\" rel=\"noreferrer noopener\">Ingress<\/a>, and an <a href=\"https:\/\/kubernetes.io\/docs\/concepts\/services-networking\/ingress-controllers\/\" target=\"_blank\" rel=\"noreferrer noopener\">Ingress Controller<\/a> on top of that in combination with a <a href=\"https:\/\/kubernetes.io\/docs\/concepts\/services-networking\/ingress\/#load-balancing\" target=\"_blank\" rel=\"noreferrer noopener\">load balancer<\/a>. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One of the quite popular Ingress Controllers is the <a href=\"https:\/\/kubernetes.github.io\/ingress-nginx\/\" target=\"_blank\" rel=\"noreferrer noopener\">Ingress-Nginx Controller<\/a>, and this is the one we&#8217;re going to use here as well. Getting this installed, can again easily be done by using <a href=\"https:\/\/helm.sh\/\" target=\"_blank\" rel=\"noreferrer noopener\">Helm<\/a>, in pretty much the same way as we did it with <a href=\"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-storage\/\" target=\"_blank\" rel=\"noreferrer noopener\">OpenEBS in the storage post<\/a>, but before we&#8217;re going to deploy the <a href=\"https:\/\/metallb.universe.tf\/\">METALLB<\/a> load balancer:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1]; title: ; notranslate\" title=\"\">\nk8s@k8s1:~$ helm install metallb metallb\/metallb --namespace metallb-system --create-namespace\nNAME: metallb\nLAST DEPLOYED: Fri Aug  9 09:43:03 2024\nNAMESPACE: metallb-system\nSTATUS: deployed\nREVISION: 1\nTEST SUITE: None\nNOTES:\nMetalLB is now running in the cluster.\n\nNow you can configure it via its CRs. Please refer to the metallb official docs\non how to use the CRs.\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">This creates a new namespace called &#8220;metalllb-system&#8221; and a few pods:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1]; title: ; notranslate\" title=\"\">\nk8s@k8s1:~$ kubectl get pods -A | grep metal\nmetallb-system         metallb-controller-77cb7f5d88-hxndw                     1\/1     Running                0               26s\nmetallb-system         metallb-speaker-5phx6                                   4\/4     Running                0               26s\nmetallb-system         metallb-speaker-bjdxj                                   4\/4     Running                0               26s\nmetallb-system         metallb-speaker-c54z6                                   4\/4     Running                0               26s\nmetallb-system         metallb-speaker-xzphl                                   4\/4     Running                0               26s\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">The next step is to create the Ingress-Nginx Controller: <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1]; title: ; notranslate\" title=\"\">\nk8s@k8s1:~$ helm upgrade --install ingress-nginx ingress-nginx --repo https:\/\/kubernetes.github.io\/ingress-nginx --namespace ingress-nginx --create-namespace\nRelease &quot;ingress-nginx&quot; does not exist. Installing it now.\nNAME: ingress-nginx\nLAST DEPLOYED: Fri Aug  9 09:49:43 2024\nNAMESPACE: ingress-nginx\nSTATUS: deployed\nREVISION: 1\nTEST SUITE: None\nNOTES:\nThe ingress-nginx controller has been installed.\nIt may take a few minutes for the load balancer IP to be available.\nYou can watch the status by running &#039;kubectl get service --namespace ingress-nginx ingress-nginx-controller --output wide --watch&#039;\n\nAn example Ingress that makes use of the controller:\n  apiVersion: networking.k8s.io\/v1\n  kind: Ingress\n  metadata:\n    name: example\n    namespace: foo\n  spec:\n    ingressClassName: nginx\n    rules:\n      - host: www.example.com\n        http:\n          paths:\n            - pathType: Prefix\n              backend:\n                service:\n                  name: exampleService\n                  port:\n                    number: 80\n              path: \/\n    # This section is only required if TLS is to be enabled for the Ingress\n    tls:\n      - hosts:\n        - www.example.com\n        secretName: example-tls\n\nIf TLS is enabled for the Ingress, a Secret containing the certificate and key must also be provided:\n\n  apiVersion: v1\n  kind: Secret\n  metadata:\n    name: example-tls\n    namespace: foo\n  data:\n    tls.crt: &lt;base64 encoded cert&gt;\n    tls.key: &lt;base64 encoded key&gt;\n  type: kubernetes.io\/tls\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Same story here, we get a new namespace:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1]; title: ; notranslate\" title=\"\">\nk8s@k8s1:~$ kubectl get pods -n ingress-nginx\nNAME                                        READY   STATUS    RESTARTS   AGE\ningress-nginx-controller-69bd47995d-krt7h   1\/1     Running   0          2m33s\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">At this stage, you&#8217;ll notice that we still do not have any services exposed externally ( we still see &#8220;&lt;pending&gt;&#8221; for the EXTERNAL-IP):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1]; title: ; notranslate\" title=\"\">\nk8s@k8s1:~$ kubectl get svc -A | grep nginx\ningress-nginx          ingress-nginx-controller               LoadBalancer   10.109.240.37    &lt;pending&gt;     80:31719\/TCP,443:32412\/TCP                              103s\ningress-nginx          ingress-nginx-controller-admission     ClusterIP      10.103.255.169   &lt;none&gt;        443\/TCP                                                 103s\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">This is not a big surprise, as we did not tell the load balancer which IP addresses to request\/assign. This is done easily:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1,21,24]; title: ; notranslate\" title=\"\">\nk8s@k8s1:~$ cat lb.yaml \n---\napiVersion: metallb.io\/v1beta1\nkind: IPAddressPool\nmetadata:\n  name: default\n  namespace: metallb-system\nspec:\n  addresses:\n  - 192.168.122.210-192.168.122.215\n  autoAssign: true\n---\napiVersion: metallb.io\/v1beta1\nkind: L2Advertisement\nmetadata:\n  name: default\n  namespace: metallb-system\nspec:\n  ipAddressPools:\n  - default\nk8s@k8s1:~$ kubectl apply -f lb.yaml \nipaddresspool.metallb.io\/default created\nl2advertisement.metallb.io\/default created\nk8s@k8s1:~$ kubectl get services -n ingress-nginx \nNAME                                 TYPE           CLUSTER-IP       EXTERNAL-IP       PORT(S)                      AGE\ningress-nginx-controller             LoadBalancer   10.109.240.37    192.168.122.210   80:31719\/TCP,443:32412\/TCP   3m32s\ningress-nginx-controller-admission   ClusterIP      10.103.255.169   &lt;none&gt;            443\/TCP                      3m32s\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">From now on the LoadBalancer got an IP address automatically assigned from the pool of addresses we&#8217;ve assigned. The next steps are covered in the <a href=\"https:\/\/cloudnative-pg.io\/documentation\/1.23\/expose_pg_services\/\">CloudNativePG<\/a> documentation: First we need a config map for the service we want to expose:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1,10]; title: ; notranslate\" title=\"\">\nk8s@k8s1:~$ cat tcp-services-configmap.yaml \napiVersion: v1\nkind: ConfigMap\nmetadata:\n  name: tcp-services\n  namespace: ingress-nginx\ndata:\n  5432: default\/my-pg-cluster-rw:5432\n\nk8s@k8s1:~$ kubectl apply -f tcp-services-configmap.yaml\nconfigmap\/tcp-services created\nk8s@k8s1:~$ kubectl get cm -n ingress-nginx\nNAME                       DATA   AGE\ningress-nginx-controller   1      6m4s\nkube-root-ca.crt           1      6m8s\ntcp-services               1      12s\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Now we need to modify the ingress-nginx service to include the new port:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1,28,30]; title: ; notranslate\" title=\"\">\nk8s@k8s1:~$ kubectl get svc ingress-nginx-controller -n ingress-nginx -o yaml &gt; service.yaml\nk8s@k8s1:~$ vi service.yaml \n...\n  ports:\n  - appProtocol: http\n    name: http\n    nodePort: 31719\n    port: 80\n    protocol: TCP\n    targetPort: http\n  - appProtocol: https\n    name: https\n    nodePort: 32412\n    port: 443\n    protocol: TCP\n    targetPort: https\n  - appProtocol: tcp\n    name: postgres\n    port: 5432\n    targetPort: 5432\n...\nk8s@k8s1:~$ kubectl apply -f service.yaml\nWarning: resource services\/ingress-nginx-controller is missing the kubectl.kubernetes.io\/last-applied-configuration annotation which is required by kubectl apply. kubectl apply should only be used on resources created declaratively by either kubectl create --save-config or kubectl apply. The missing annotation will be patched automatically.\nservice\/ingress-nginx-controller configured\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">The last step is to link our config map into the &#8220;ingress-nginx-controller&#8221; deployment:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1,12]; title: ; notranslate\" title=\"\">\nk8s@k8s1:~$ kubectl edit deploy ingress-nginx-controller -n ingress-nginx\n...\n    spec:\n      containers:\n      - args:\n        - \/nginx-ingress-controller\n        - --publish-service=$(POD_NAMESPACE)\/ingress-nginx-controller\n        - --election-id=ingress-nginx-leader\n        - --controller-class=k8s.io\/ingress-nginx\n        - --ingress-class=nginx\n        - --configmap=$(POD_NAMESPACE)\/ingress-nginx-controller\n        - --tcp-services-configmap=ingress-nginx\/tcp-services\n        - --validating-webhook=:8443\n        - --validating-webhook-certificate=\/usr\/local\/certificates\/cert\n        - --validating-webhook-key=\/usr\/local\/certificates\/key\n        - --enable-metrics=false\n...\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">From now on the PostgreSQL cluster can be reached from outside the Kubernetes cluster:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1,5]; title: ; notranslate\" title=\"\">\nk8s@k8s1:~$ kubectl get svc -n ingress-nginx\nNAME                                 TYPE           CLUSTER-IP       EXTERNAL-IP       PORT(S)                                     AGE\ningress-nginx-controller             LoadBalancer   10.109.240.37    192.168.122.210   80:31719\/TCP,443:32412\/TCP,5432:32043\/TCP   6d23h\ningress-nginx-controller-admission   ClusterIP      10.103.255.169   &lt;none&gt;            443\/TCP                                     6d23h\nk8s@k8s1:~$ psql -h 192.168.122.210 \nPassword for user k8s: \npsql: error: connection to server at &quot;192.168.122.210&quot;, port 5432 failed: FATAL:  password authentication failed for user &quot;k8s&quot;\nconnection to server at &quot;192.168.122.210&quot;, port 5432 failed: FATAL:  password authentication failed for user &quot;k8s&quot;\n\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>Now that we know how we can benchmark a CloudNativePG deployment, it is time to look at how we can connect external applications to the PostgreSQL cluster. Usually, applications run in the same Kubernetes cluster and can directly talk to our PostgreSQL deployment, but sometimes it is required to also connect with external applications or&hellip;&nbsp;<\/p>\n","protected":false},"author":28,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","neve_meta_reading_time":"","_themeisle_gutenberg_block_has_review":false,"footnotes":""},"categories":[955,4133,1320],"tags":[],"class_list":["post-33998","post","type-post","status-publish","format-standard","category-cloud","category-database","category-devops"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.8 (Yoast SEO v28.8) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>CloudNativePG \u2013 Connecting external applications - dbi services Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-connecting-external-applications\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CloudNativePG \u2013 Connecting external applications\" \/>\n<meta property=\"og:description\" content=\"Now that we know how we can benchmark a CloudNativePG deployment, it is time to look at how we can connect external applications to the PostgreSQL cluster. Usually, applications run in the same Kubernetes cluster and can directly talk to our PostgreSQL deployment, but sometimes it is required to also connect with external applications or&hellip;&nbsp;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-connecting-external-applications\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi services Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/dbiservices\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-08-16T07:27:32+00:00\" \/>\n<meta name=\"author\" content=\"Open source Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@dbiservices\" \/>\n<meta name=\"twitter:site\" content=\"@dbiservices\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Open source Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/cloudnativepg-connecting-external-applications\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/cloudnativepg-connecting-external-applications\\\/\"},\"author\":{\"name\":\"Open source Team\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/0b4548362cac3eeff8b3eaf329e3530a\"},\"headline\":\"CloudNativePG \u2013 Connecting external applications\",\"datePublished\":\"2024-08-16T07:27:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/cloudnativepg-connecting-external-applications\\\/\"},\"wordCount\":451,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\"},\"articleSection\":[\"Cloud\",\"Database\",\"DevOps\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/cloudnativepg-connecting-external-applications\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/cloudnativepg-connecting-external-applications\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/cloudnativepg-connecting-external-applications\\\/\",\"name\":\"CloudNativePG \u2013 Connecting external applications - dbi services Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\"},\"datePublished\":\"2024-08-16T07:27:32+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/cloudnativepg-connecting-external-applications\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/cloudnativepg-connecting-external-applications\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/cloudnativepg-connecting-external-applications\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CloudNativePG \u2013 Connecting external applications\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\",\"name\":\"dbi services Blog\",\"description\":\"#BeSharing\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\",\"name\":\"dbi services\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/dbi-services-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/dbi-services-logo.png\",\"width\":512,\"height\":512,\"caption\":\"dbi services\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/dbiservices\\\/\",\"https:\\\/\\\/x.com\\\/dbiservices\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/dbi-services\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/dbiservices\"],\"description\":\"Swiss IT consulting and services company specialized in efficient data infrastructures and platforms: databases, application servers, cloud, DevOps, digitalization, analytics, data quality and monitoring. Headquartered in Del\u00e9mont with offices in Nyon, Basel, Bern and Zurich.\",\"email\":\"info@dbi-services.com\",\"telephone\":\"+41 32 422 96 00\",\"legalName\":\"dbi services SA\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/0b4548362cac3eeff8b3eaf329e3530a\",\"name\":\"Open source Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/open-source-author.png\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/open-source-author.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/05\\\/open-source-author.png\",\"caption\":\"Open source Team\"},\"description\":\"Posts published under the Open source Team account are collective contributions by the dbi services open infrastructure consultants. The practice covers open-source databases and platforms, PostgreSQL first of all, along with MySQL, MariaDB, and Linux, from architecture, replication, and high availability to performance tuning and operations under service level agreements, and contributes actively to the PostgreSQL community.\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/author\\\/open-source-team\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"CloudNativePG \u2013 Connecting external applications - dbi services Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-connecting-external-applications\/","og_locale":"en_US","og_type":"article","og_title":"CloudNativePG \u2013 Connecting external applications","og_description":"Now that we know how we can benchmark a CloudNativePG deployment, it is time to look at how we can connect external applications to the PostgreSQL cluster. Usually, applications run in the same Kubernetes cluster and can directly talk to our PostgreSQL deployment, but sometimes it is required to also connect with external applications or&hellip;&nbsp;","og_url":"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-connecting-external-applications\/","og_site_name":"dbi services Blog","article_publisher":"https:\/\/www.facebook.com\/dbiservices\/","article_published_time":"2024-08-16T07:27:32+00:00","author":"Open source Team","twitter_card":"summary_large_image","twitter_creator":"@dbiservices","twitter_site":"@dbiservices","twitter_misc":{"Written by":"Open source Team","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-connecting-external-applications\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-connecting-external-applications\/"},"author":{"name":"Open source Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/0b4548362cac3eeff8b3eaf329e3530a"},"headline":"CloudNativePG \u2013 Connecting external applications","datePublished":"2024-08-16T07:27:32+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-connecting-external-applications\/"},"wordCount":451,"commentCount":0,"publisher":{"@id":"https:\/\/www.dbi-services.com\/#organization"},"articleSection":["Cloud","Database","DevOps"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/cloudnativepg-connecting-external-applications\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-connecting-external-applications\/","url":"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-connecting-external-applications\/","name":"CloudNativePG \u2013 Connecting external applications - dbi services Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2024-08-16T07:27:32+00:00","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-connecting-external-applications\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/cloudnativepg-connecting-external-applications\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/cloudnativepg-connecting-external-applications\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"CloudNativePG \u2013 Connecting external applications"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi services Blog","description":"#BeSharing","publisher":{"@id":"https:\/\/www.dbi-services.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.dbi-services.com\/#organization","name":"dbi services","url":"https:\/\/www.dbi-services.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2026\/09\/dbi-services-logo.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2026\/09\/dbi-services-logo.png","width":512,"height":512,"caption":"dbi services"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/dbiservices\/","https:\/\/x.com\/dbiservices","https:\/\/www.linkedin.com\/company\/dbi-services\/","https:\/\/www.youtube.com\/user\/dbiservices"],"description":"Swiss IT consulting and services company specialized in efficient data infrastructures and platforms: databases, application servers, cloud, DevOps, digitalization, analytics, data quality and monitoring. Headquartered in Del\u00e9mont with offices in Nyon, Basel, Bern and Zurich.","email":"info@dbi-services.com","telephone":"+41 32 422 96 00","legalName":"dbi services SA"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/0b4548362cac3eeff8b3eaf329e3530a","name":"Open source Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/05\/open-source-author.png","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/05\/open-source-author.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/05\/open-source-author.png","caption":"Open source Team"},"description":"Posts published under the Open source Team account are collective contributions by the dbi services open infrastructure consultants. The practice covers open-source databases and platforms, PostgreSQL first of all, along with MySQL, MariaDB, and Linux, from architecture, replication, and high availability to performance tuning and operations under service level agreements, and contributes actively to the PostgreSQL community.","url":"https:\/\/www.dbi-services.com\/blog\/author\/open-source-team\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/33998","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=33998"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/33998\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=33998"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=33998"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=33998"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}