什么是ingress? 官方对此这样描述:Ingress exposes HTTP and HTTPS routes from outside the cluster to services within the cluster. Traffic routing is controlled by rules defined on the Ingress resource. internet | [ Ingress ] --|-----|-- [ Services ]An Ingress may be configured to give Services externally-reachable URLs, load balance traffic, terminate SSL / TLS, and offer name based virtual hosting. An Ingress controller is responsible for fulfilling the Ingress, usually with a load balancer, though it may also configure your edge router or additional frontends to help handle the traffic.An Ingress does not expose arbitrary ports or protocols. Exposing services other than HTTP and HTTPS to the internet typically uses a service of type Service.Type=NodePort or Service.Type=LoadBalancer.简而言之,通过ingress的形式暴露服务只需两个条件:1、创建Ingress资源,该资源声明了转发规则,即流量到达ingress后将会转发到哪个(哪些)service。2、搭建一个Ingress Controller监听ingress资源,并实现ingress声明的转发规则。相比于NodePort和LoadBalancer,ingress的配置可能相对复杂,但带来的强大功能会完全掩盖开发部署的繁琐。有哪些Ingress Controller可供选择?nginx Ingress Controller作为反代巨头,nginx提供的Ingress Controller被官方作为默认的L7 Ingress Controller实现。Traefik Ingress ControllerTraefik作为边缘路由新贵,凭借他和容器平台的良好适性(go编写)以及创新的配置读取功能(其他代理仅支持纯文本配置)在容器领域获取了大量的簇拥,我自己也是Traefik粉丝之一。上述两种Ingress Controller在L7代理方面非常稳定高效且功能齐全,完全可以在生产环境使用。但在RDS场景下,或说在TCP长连接需求的场景下却显得不尽人意: