haproxy - HAProxy 到 Istio 入口
问题描述
目前,我正在尝试配置一个负载均衡器,流量将从该负载均衡器发送到 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:32009/status/418:
下面是我的 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]:后端 httpbin 没有可用的服务器!
你能帮忙找出后端的正确配置吗?
解决方案
最后在 HAProxy 社区的帮助下,我找到了 Istio Ingress 的正确配置。这是非常基本的。请根据您的需要更新设置。下面是配置链接。
https://gist.github.com/emamulandalib/2a613f5308c29518fcbcdc6b3bad3900
推荐阅读
- javascript - 控制台日志未显示请求和响应 json
- c++ - 具有两个类的 C++ 拼写检查程序;字典和单词
- ios - 为特定单元格设置 UITableView 单元格类型的更好方法
- python - 在类上使用安全散列函数而不是 hash()
- python - 用于分离一系列照片的脚本
- azure - 安装 Blob 存储的 Azure Databricks
- python - 如何使用 PyQt5 运行 while 循环
- sql - 如何从现有表记录创建视图,同时添加不存在的新记录
- node.js - 尝试在终端中使用 geoproject 命令时抛出错误
- apache-kafka - kafka Connect:Tasks.max 超过 # 个分区,但状态显示为 RUNNING