我为我的项目设置了这个配置:
https://cloud.google.com/vpc/images/shared-vpc/shared-vpc-example-two-tier.svg
一切都是在Google Kubernetes引擎下运行的。
必须连接到
。
kubectl describe svc gateway-node-api --namespace master
Name: gateway-node-api
Namespace: master
Labels: app=node-api
chart=node-api-0.1.2
heritage=Tiller
release=gateway-node-api
Annotations: cloud.google.com/load-balancer-type=Internal
Selector: app=node-api,release=gateway-node-api
Type: LoadBalancer
IP: 172.16.23.21
LoadBalancer Ingress: 172.16.4.5
Port: http 3000/TCP
TargetPort: http/TCP
NodePort: http 31386/TCP
Endpoints: 172.20.2.30:3000
Session Affinity: None
External Traffic Policy: Cluster在第1层NodeJS服务中使用172.16.4.5:3000不会连接到第2层NodeJS API。
我可能错过了什么?
发布于 2018-08-07 15:09:04
发现了我的问题,我没有阅读足够的防火墙规则文档:
https://cloud.google.com/vpc/docs/firewalls
配置共享VPC后,我创建了一个规则,应用于所有传入请求的所有网络:
shared-network-allow-ssh-icmp shared-network INGRESS 1000 icmp,tcp:22,tcp:80并意识到,我还需要应用一条规则,允许在接收来自第1层服务子网的请求时,可以在所有tcp端口上访问网络的所有实例:
service1-allow-tcp shared-network INGRESS 1000 tcp:1-65535https://stackoverflow.com/questions/51714385
复制相似问题