These are the steps:
Why i can't reach postgresql? Is it because SQL Private IP is in Beta mode, or i'm missing smth here?
Yes, a proxy is the way to go as mentioned in earlier response, because peering is not transitive.
It will be straightforward to access an SQL proxy in network "A" from peered network "B" VM.
As for access from Kubernetes cluster in network "B", there is one possible pitfall. By default, Kubernetes will not SNAT traffic destined to 10.0.0.0/8 and will try to keep it local. So you will need to change iptables
rules on host instances to reach outside.
A permanent solution is to set up DaemonSet
, but you can test this theory by manual changes on host first. For example:
iptables -A POSTROUTING -d 10.11.0.0/24 \
-m addrtype ! --dst-type LOCAL -j MASQUERADE -t nat
Here is a link to an excellent, simple guide https://blog.mrtrustor.net/post/iptables-kubernetes/ .
Cloud SQL Private IP access is setup through peering so network A is peered with network Z, which contains your Cloud SQL instance. When you peer A with B, B does not have access to network Z.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.