从HAProxy到Istio Ingress的转变

问题描述 投票:1回答:1

目前,我正试图配置一个负载均衡器,流量将从那里发送到Kubernetes集群。在集群的边缘,Istio ingress正在为集群的外部请求提供服务。HAProxy版本为1.8

我可以使用下面的命令从集群外部访问服务。

curl -k -HHost:httpbin.example.com --resolve httpbin.example.com:32009:192.168.50.10。https:/httpbin.example.com:32009status418。:

以下是我的HAProxy配置。

前端:

frontend https
    bind *:443 ssl crt /etc/ssl/certs/site.pem
    mode tcp

    tcp-request inspect-delay 5s
    tcp-request content accept if { req_ssl_hello_type 1 }

    default_backend httpbin

后端。

  backend httpbin
    balance roundrobin
    mode tcp

    acl httpbin_app req_ssl_sni -i httpbin.example.com
    use-server master if httpbin_app

    server master 192.168.50.10:32009 check ssl verify none

     http-request set-header Host httpbin.example.com
     http-request set-header X-Forwarded-For %[src]
     http-request set-header X-Forwarded-Port %[dst_port]
     http-request add-header X-Forwarded-Proto https if { ssl_fc }

使用HAProxy,我总是得到503。另外,在启动时,HAProxy显示以下一行字。

haproxy[14260]: backend httpbin has no server available!

你能帮我找出正确的后台配置吗?

haproxy kubernetes-ingress istio
1个回答
2
投票

最后在HAProxy社区的帮助下,我找到了Istio Ingress的正确配置。这是非常基本的配置。请根据你的需要更新设置。下面是配置的链接。

https:/gist.github.comemamulandalib2a613f5308c29518fcbcdc6b3bad3900。

© www.soinside.com 2019 - 2024. All rights reserved.