kubernetes - 是否可以使用单个 GKE 入口 Controller 拥有多个入口资源

标签 kubernetes google-cloud-platform google-kubernetes-engine kubernetes-ingress

GKE Ingress documentation
它指出:

When you create an Ingress object, the GKE Ingress controller creates a Google Cloud HTTP(S) Load Balancer and configures it according to the information in the Ingress and its associated Services.


对我来说,我似乎不能有多个 ingress resources使用单个 GCP 入口 Controller 。相反,GKE 会为每个入口资源创建一个新的入口 Controller 。
真的是这样,还是可以在 GKE 中使用单个入口 Controller 拥有多个入口资源?
我希望将一个 GCP LoadBalancer 作为配置静态 IP 和 DNS 的入口 Controller ,然后在集群中运行多个应用程序,每个应用程序使用特定于应用程序的主机和/或路径规范注册自己的入口资源。
请注意,我对 GKE、GCP 和 Kubernetes 总体上很陌生,所以可能是我误解了一些东西。

最佳答案

是的,可以为多个入口资源使用单个入口 Controller 。
您可以根据路径要求创建多个入口资源,并且所有资源都将由单个入口 Controller 管理。
也有多个入口 Controller 选项可用,您也可以使用 Nginx 来创建一个 LB 并管理路径。
如果您使用 创建服务,请在 Kubernetes 内部类型 负载均衡器 它将创建 GCP 中的新 LB 资源 所以确保你的微服务类型是 ClusterIP并且您的所有流量都通过 进入 K8s 集群入口小路。
当您设置入口 Controller 时,它将创建一个类型为 LoadBalancer 的服务。您可以在 DNS 服务器中使用该 IP 将子域和路径转发到 K8s 集群。

关于kubernetes - 是否可以使用单个 GKE 入口 Controller 拥有多个入口资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65171303/

相关文章:

amazon-web-services - 无法从Internet访问AWS EKS集群,DockerHub和Traefik

google-kubernetes-engine - 无法使用 kustomize 修补服务名称

node.js - Big Query - GKE 中部署的 Nodejs 应用程序的 Util.parseHttpRespBody 凭证无效

python - 尝试使用 python 连接到 Google 云存储(GCS)

docker - 使用 webhook 将 kubernetes 部署通知发送到松弛 channel

nginx - 无法使用 Ingress SubPath 访问 GUI

kubernetes - 在 kubernetes 中使用 CrashLoopBackOff 状态重新部署 statefulset

docker - jenkins管道中docker gcloud容器中的kubectl问题

cloud - 创建 gpu 谷歌实例时出错

python - App Engine gcloud : Can't find Python files in Home directory, 但它们已经上线?