# Exposing Percona Postgres deployment externally in AKS

**URL:** <https://forums.percona.com/t/exposing-percona-postgres-deployment-externally-in-aks/19351>\
**Category:** Percona Operator for PostgreSQL\
**Tags:** percona, postgres\
**Created:** [December 28, 2022, 11:11am UTC](https://forums.percona.com/t/exposing-percona-postgres-deployment-externally-in-aks/19351 "2022-12-28T11:11:47Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![skandhw](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@skandhw](https://forums.percona.com/u/skandhw)\
**Post date:** [December 28, 2022, 11:11am UTC](https://forums.percona.com/t/exposing-percona-postgres-deployment-externally-in-aks/19351/1 "2022-12-28T11:11:47Z")

</div>

Hi Team,  
We’re doing a POC for Percona postgres on AKS(Azure Kubernetes) environment with v1.1 and facing issue while making external connectivity. We have exposed the cluster1 externally through a internal AKS load balancer.

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE  
**cluster1** LoadBalancer 10.119.253.184 **10.126.96.150** 2022:30275/TCP,5432:30693/TCP 8s  
cluster1-backrest-shared-repo ClusterIP 10.119.254.1 2022/TCP 41m  
cluster1-pgbouncer ClusterIP 10.119.253.129 5432/TCP 41m  
cluster1-replica ClusterIP 10.119.254.128 2022/TCP,5432/TCP 41m  
postgres-operator ClusterIP 10.119.255.215 8443/TCP,4171/TCP,4150/TCP 3h47m

However, while trying to access is from my laptop getting the below error:  
$ curl -k -vvvv telnet://10.126.96.150:5432

- Trying 10.126.96.150:5432…  
% Total % Received % Xferd Average Speed Time Time Time Current  
Dload Upload Total Spent Left Speed  
0 0 0 0 0 0 0 0 --:–:-- 0:00:20 --:–:-- 0\* connect to 10.126.96.150 port 5432 failed: Timed out
- Failed to connect to 10.126.96.150 port 5432 after 21036 ms: Timed out  
0 0 0 0 0 0 0 0 --:–:-- 0:00:21 --:–:-- 0  
\*\*\* Closing connection 0\*\*  
**curl: (28) Failed to connect to 10.126.96.150 port 5432 after 21036 ms: Timed out**

$ curl -k -vvvv telnet://10.126.96.150:30693

- Trying 10.126.96.150:30693…  
% Total % Received % Xferd Average Speed Time Time Time Current  
Dload Upload Total Spent Left Speed  
0 0 0 0 0 0 0 0 --:–:-- 0:00:20 --:–:-- 0\* connect to 10.126.96.150 port 30693 failed: Timed out
- Failed to connect to 10.126.96.150 port 30693 after 21046 ms: Timed out  
0 0 0 0 0 0 0 0 --:–:-- 0:00:21 --:–:-- 0  
\*\*\* Closing connection 0\*\*  
**curl: (28) Failed to connect to 10.126.96.150 port 30693 after 21046 ms: Timed out**

Can anyone suggest for possible solutions on this.

Thanks…

---

<div class="post-metadata">

**Author:** ![joe.brockmeier](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/joe.brockmeier/32/8505_2.png) [@joe.brockmeier](https://forums.percona.com/u/joe.brockmeier)\
**Post date:** [December 29, 2022, 2:14pm UTC](https://forums.percona.com/t/exposing-percona-postgres-deployment-externally-in-aks/19351/2 "2022-12-29T14:14:55Z")

</div>

It looks like external IP it’s showing you is a private IP address / non-routable over the internet. Have you attached a public IP?

---

<div class="post-metadata">

**Author:** ![skandhw](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@skandhw](https://forums.percona.com/u/skandhw)\
**Post date:** [December 30, 2022, 7:17am UTC](https://forums.percona.com/t/exposing-percona-postgres-deployment-externally-in-aks/19351/3 "2022-12-30T07:17:48Z")

</div>

I can see the route table attached to the subnet is having internet route:

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/1/14408990a6398610b1367b61aec0e3ec42ef9ec1.png)  
By attaching a public IP, you mean do I need to create a external AKS load balancer. But I want the traffic to be restricted only within my company’s network (external to kubernetes but internally within my company’s network)

---

<div class="post-metadata">

**Author:** ![skandhw](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@skandhw](https://forums.percona.com/u/skandhw)\
**Post date:** [January 3, 2023, 7:24am UTC](https://forums.percona.com/t/exposing-percona-postgres-deployment-externally-in-aks/19351/4 "2023-01-03T07:24:47Z")

</div>

Can anyone help further on this topic.

---

<div class="post-metadata">

**Author:** ![joe.brockmeier](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/joe.brockmeier/32/8505_2.png) [@joe.brockmeier](https://forums.percona.com/u/joe.brockmeier)\
**Post date:** [January 3, 2023, 1:40pm UTC](https://forums.percona.com/t/exposing-percona-postgres-deployment-externally-in-aks/19351/5 "2023-01-03T13:40:14Z")

</div>

When you tried to connect to the instance were you on the same network (what IP/subnet are you connecting from) or trying to connect over the public network?

---

<div class="post-metadata">

**Author:** ![Sergey\_Pronin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sergey_pronin/32/14887_2.png) [@Sergey\_Pronin](https://forums.percona.com/u/Sergey_Pronin)\
**Post date:** [January 6, 2023, 1:16pm UTC](https://forums.percona.com/t/exposing-percona-postgres-deployment-externally-in-aks/19351/6 "2023-01-06T13:16:47Z")

</div>

> [@skandhw](#):
>
> We have exposed the cluster1 externally through a internal AKS load balancer.

Hey @skandhw ,

looks like a networking prob to me (sorry for stating the obvious). Internal load balancer means that you can connect to it from some private network that you have in Azure. Or through some sort of VPN or Peering.

So if your laptop does not have access to this private network in Azure, you will not be able to access the cluster. What Joe is suggesting is to use public load balancer instead. This is not recommended for production, but will work for you if you are just exploring.

---

<div class="post-metadata">

**Author:** ![skandhw](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@skandhw](https://forums.percona.com/u/skandhw)\
**Post date:** [January 19, 2023, 4:30am UTC](https://forums.percona.com/t/exposing-percona-postgres-deployment-externally-in-aks/19351/7 "2023-01-19T04:30:09Z")

</div>

Hi Sergey,

We have figured out the approach for external connectivity to the database, and now we’re able to connect DB from outside.  
Just one question, is there any detailed documentation/ explanation available to deep dive into the Percona PG operator.

Thanks

---

<div class="post-metadata">

**Author:** ![Sergey\_Pronin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sergey_pronin/32/14887_2.png) [@Sergey\_Pronin](https://forums.percona.com/u/Sergey_Pronin)\
**Post date:** [January 19, 2023, 7:31am UTC](https://forums.percona.com/t/exposing-percona-postgres-deployment-externally-in-aks/19351/8 "2023-01-19T07:31:18Z")

</div>

@skandhw the docs can be found here: [Percona Operator for PostgreSQL](https://docs.percona.com/percona-operator-for-postgresql/index.html)

I’m more than happy to jump into a call with you to discuss anything pg operator related. Especially curious to learn your use case. Please send me a DM.

---

<div class="post-metadata">

**Author:** ![skandhw](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@skandhw](https://forums.percona.com/u/skandhw)\
**Post date:** [January 30, 2023, 3:02am UTC](https://forums.percona.com/t/exposing-percona-postgres-deployment-externally-in-aks/19351/9 "2023-01-30T03:02:00Z")

</div>

Sure Sergey. Glad to connect with you.
