我正在尝试从 GAE 中的项目访问 GKE 上的弹性搜索集群 - 灵活。由于我不需要外部负载均衡器,因此我正在遵循本指南: https : //cloud.google.com/kubernetes-engine/docs/how-to/internal-load-balancing GKE 和 GAE 都已部署在同一地区,但对弹性搜索集群的调用一直超时。有没有人这样做并可以分享一些提示将不胜感激!
我的service.yaml
文件如下所示:
apiVersion: v1
kind: Service
metadata:
name: internalloadbalancerservice
annotations:
cloud.google.com/load-balancer-type: "Internal"
labels:
app.kubernetes.io/component: elasticsearch-server
app.kubernetes.io/name: elasticsearch #label selector service
spec:
type: LoadBalancer
loadBalancerSourceRanges: # restrict access
- xxxxxxxx
ports:
- name: myport
port: 9000
protocol: TCP # default; can also specify UDP
selector:
app.kubernetes.io/name : elasticsearch # label selector for Pods
app.kubernetes.io/component: elasticsearch-server