kubernetes - GKE/Istio:外部世界无法连接到私有集群中的服务
问题描述
我通过 Cloud Console UI 使用 Istio 创建了一个私有 GKE 集群。该集群设置了 VPC 对等互连,以便能够访问另一个 Google Cloud 项目中的另一个私有 GKE 集群。
我在命名空间website
中的 Kubernetes 中创建了一个带有服务的部署(称为 )staging
。我的目标是使用 Envoy 代理通过 Istio 向外界公开这项服务。我已经按照本指南VirtualService
创建了必要的内容并Gateway
这样做了。
当运行“kubectl exec ...”访问私有集群中的 pod 时,我可以成功连接到website
服务的内部 IP 地址,并以“curl”查看该服务的输出。
我已经设置了一个 NAT 网关,因此私有集群中的 pod 可以连接到 Internet。我通过从podcurl
中输入各种非 Google 网页来确认这一点。website
但是,正如上面的指南所述,我无法使用website
服务的从外部连接到服务。相反,-ing 会导致超时。External IP
istio-ingressgateway
curl
External IP
我已将所有相关资源的完整 YAML 配置放在一个私有 Gist 中,这里:https ://gist.github.com/marceldegraaf/0f36ca817a8dba45ac97bf6b310ca282
我想知道我的配置中是否缺少某些内容,或者我的用例实际上是不可能的?
解决方案
查看您的要点,我怀疑问题出Gateway
在istio-ingressgateway
.
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: website-gateway
namespace: staging
labels:
version: v1
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"
特别是我不相信这selector
部分是正确的。
您应该能够
kubectl describe po -n istio-system istio-ingressgateway-rrrrrr-pppp
在 Istio Ingress Gateway pod 中找出选择器尝试匹配的内容。
推荐阅读
- java - 如何解决数组赋值的 java.lang.NullPointerException
- dialogflow-es - 在 Dialogflow Fulfillment 中为所需参数分配默认值
- python - 编写第一个脚本时,硒库没有出现在 pycharm 中
- python - 使用 http.client 登录在线 Farasa lemmatizer 并对阿拉伯语文本文件内容进行词形还原
- javascript - 如何从 .js 文件中获取数据并更新此文件
- javascript - 尝试分配角色时,我不断收到错误消息
- javascript - 如何从 Chrome 扩展创建弹出模式
- assembly - Why do kill dependency instructions consume reservation station slots?
- python - Azure Blob 绑定与 Azure 函数 (Python)
- php - Postgres & PHP- 将 UTC 时间戳转换为本地时间