简体   繁体   English

k8s群集的NAT网关IP未反映在Pod中

[英]NAT Gateway IP for k8s cluster not reflected in pods

I tried to create a NAT gateway as mentioned in the given tutorial: https://cloud.google.com/solutions/using-a-nat-gateway-with-kubernetes-engine After applying the terraform, though the NAT Gateway is created and assigned an IP, any outgoing traffic from the pods still comes as the Node's IP rather than the NAT Gateway's IP. 我尝试创建给定教程中提到的NAT网关: https ://cloud.google.com/solutions/using-a-nat-gateway-with-kubernetes-engine应用terraform后,尽管已创建了NAT网关如果分配了IP,则来自Pod的所有传出流量仍将作为节点的IP,而不是NAT网关的IP。 Couldn't find any troubleshooting guide for the same. 找不到相同的任何故障排除指南。 Any guidance would be appreciated. 任何指导将不胜感激。

First of all you need to ensrure you GKE cluster is private since by now it only works using Kubernetes “private” clusters . 首先,您需要确保GKE集群是私有的,因为目前它仅适用于Kubernetes的“私有”集群 If the VM instances have an external IP, the routing will be through them and not by Cloud NAT. 如果VM实例具有外部IP,则路由将通过它们而不是通过Cloud NAT。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM