Can you route an Kubernetes ingress resource based on port?

二次信任 提交于 2019-12-20 01:52:15

问题


I have a Kubernetes service that expose two ports, one for the external interface (target port 8080) and one for the admin interface (target port 8081). I'd like to make both of these endpoints accessible over the internet using https so thus I think I want use an ingress resource. The ingress resource creates a static IP for the load balancer and I'd like to route port 80 and 443 to the external interface (8080) and port 81 (http) and port 4431 (https) to the admin interface (8081). Is this possible and if so how?


回答1:


Via separate Ingress objects, you should be able to direct HTTP and HTTPS traffic to different ports and/or services, and hostnames can map to distinct ports and/or services.

However, Ingress currently assumes port 80 for HTTP and 443 for HTTPS for ingress, so it's not currently possible to direct traffic to ports 81 and 4431 via Ingress. I recommend using a different hostname for the admin interface.

Note that TLS is only supported in release 1.2.



来源:https://stackoverflow.com/questions/33808912/can-you-route-an-kubernetes-ingress-resource-based-on-port

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!