【发布时间】:2021-02-03 15:03:43
【问题描述】:
我有两个名为 svc1 和 svc2 的服务。我可以让 ingress 向每个服务发送具有不同基本 URL 的相同域吗,即:
ingress.domain/svc1/path-here -> svc1 收到这个请求,路径改写为/path-here
ingress.domain/svc2/path-here -> svc2 收到这个请求,路径改写为/path-here
所以我可以为这个 k8s 实例上的所有服务使用一个域?
【问题讨论】:
-
您的意思是:在您获得域访问权限
ingress.domain/svc2/path-here后,它将重定向到ingress.domain/path-here -
我的意思是
svc2服务的pod会收到请求,看到它的请求URL是ingress.domain/path-here。ingress.domain解析为 k8s 实例 IP。 -
请分享您的示例入口 ymal 文件。
标签: kubernetes kubernetes-ingress