<p>I have a k8s cluster on google cloud. I want to connect to cloud sql postgres using private ip from one of my pod just for testing purpose.</p>
<p>I'm able to access private ip from the node but not from pod. How to resolve this?</p>

Krishna
<p>This GitHub Issue details the issue fully, but you essentially need to utilize a VPC Native GKE cluster so that way the cluster's network is bridged to the Cloud SQL instance's network.</p>
<p>The full command below is an example pulled from the VPC Native documentation, but essentially you'll need to utilize the <code>--enable-ip-alias</code>, <code>--subnetwork</code> <code>--cluster-secondary-range-name</code> and <code>--services-secondary-range-name</code> flags to get the cluster to be properly configured using the underlying GCP network.</p>
<pre><code>gcloud container clusters create CLUSTER_NAME \
    --region=COMPUTE_REGION \
    --enable-ip-alias \
    --subnetwork=SUBNET_NAME \
    --cluster-ipv4-cidr=POD_IP_RANGE \
    --services-ipv4-cidr=SERVICES_IP_RANGE
</code></pre>
<p><a href="https://cloud.google.com/kubernetes-engine/docs/how-to/alias-ips" rel="nofollow noreferrer">https://cloud.google.com/kubernetes-engine/docs/how-to/alias-ips</a>
<a href="https://github.com/GoogleCloudPlatform/k8s-config-connector/issues/201#issuecomment-640106267" rel="nofollow noreferrer">https://github.com/GoogleCloudPlatform/k8s-config-connector/issues/201#issuecomment-640106267</a></p>
