<p>I want to set up connections from a kubernetes cluster (created via <code>az acs create</code> with mostly default settings) to an Azure Postgresql instance, and I'd like to know what source-IP range to enter in postgres HBA (this is the thing Azure calls a <code>firewall-rule</code> under <code>az postgres server</code>).</p>

<p>The thing is, although I can see from the console errors (when using <code>psql</code> to test) what the current IP is that the cluster requests come from</p>

<pre><code>FATAL:  no pg_hba.conf entry for host "x.x.x.x" [...]
</code></pre>

<p>... I just don't see this IP address anywhere in the cluster properties - and anyway, it would seem a very fragile configuration to just whitelist this one IP address without knowing how it's assigned.</p>

<p>(In the Azure Portal, I do see one "Public IP" associated with the cluster master, but that's not the same as the IP seen by postgres, and, I assume, mainly for ingress.)</p>

<p>So ideally, does ACS let me control the outbound IP addresses for the cluster? And if not, can I figure out programmatically what IP or range of IPs to allow?</p>

<p>It should be the external IP for the node that the pod is scheduled on, e.g. on container engine:</p>

<pre><code>$ kubectl get no -o wide
NAME                              STATUS    AGE       VERSION   EXTERNAL-IP       OS-IMAGE                             KERNEL-VERSION
gke-cluster-1-node-1              Ready     58d       v1.5.4    &lt;example node IP&gt; Container-Optimized OS from Google   4.4.21+

$ ssh gke-cluster-1-node-1
$ curl icanhazip.com
&lt;example node IP&gt;

$ kubectl get po -o wide | grep node-1
example-pod-1                                     1/1       Running   0          11d       &lt;pod IP&gt;      gke-cluster-1-node-1
$ kubectl exec -it example-pod-1 curl icanhazip.com
&lt;example node IP&gt;
</code></pre>
