【发布时间】:2016-07-25 12:51:44
【问题描述】:
我有一些在常规 Compute Engine 节点上运行的应用程序。此外,我有一个容器集群,我正在将应用程序迁移到该集群。迟早所有应用程序都应该在 Container Engine 中,因此服务发现是直截了当的。 但目前 Compute Engine 上的应用需要能够与 Container Engine 应用通信。 Container Engine 应用程序都注册为服务。 为了测试,我使用了“echoheaders”图像:
$ kubectl describe svc echoheaders
Name: echoheaders
Namespace: default
Labels: app=echoheaders
Selector: app=echoheaders
Type: ClusterIP
IP: 10.115.249.140
Port: http 80/TCP
Endpoints: 10.112.1.3:8080
Session Affinity: None
No events.
现在的问题是我只能通过 Compute Engine 节点直接通过 10.112.1.3:8080 访问 pod 服务,但不能通过其 clusterip 10.115.249.140:80 访问。这只适用于实际的 Compute Engine 节点。
我已经尝试创建一个指向容器引擎节点之一的堡垒路线,但它仍然不起作用:
$ gcloud compute routes describe gke-cluster-1-services
creationTimestamp: '2016-04-05T05:39:55.275-07:00'
description: Route to Cluster-1 service IP range
destRange: 10.115.240.0/20
id: '926323215677918452'
kind: compute#route
name: gke-cluster-1-services
network: https://www.googleapis.com/compute/v1/projects/infrastructure-1173/global/networks/infra
nextHopInstance: https://www.googleapis.com/compute/v1/projects/infrastructure-1173/zones/europe-west1-d/instances/gke-cluster-1-5679a61a-node-f7iu
priority: 500
selfLink: https://www.googleapis.com/compute/v1/projects/infrastructure-1173/global/routes/gke-cluster-1-services
在防火墙上,计算节点可以连接到任何节点。
任何人碰巧有指针,允许计算引擎节点通过其 ClusterIP 访问计算节点服务可能缺少什么?
谢谢
【问题讨论】:
标签: google-compute-engine google-cloud-platform kubernetes google-kubernetes-engine