curl - 如何正确询问 req_ssl_sni HAproxy 定义的 Kubernetes Ingress?
问题描述
我试图弄清楚如何验证 Kubernetes Ingress 是否正常工作以及它是否正在检查客户端证书。目前,这部分基础设施的组成如下:
HAproxy 配置如下:
#------------------
# Global settings
#------------------
# Global and default settings here, hidden for simplicity
#------------------
# frontend instances
#------------------
frontend stats
bind *:80
mode http
# Other frontend blocks here
frontend frontend_ssl_prod_publicip3
bind privateip4:443,privateip5:443
log-format %Ci:%Cp\ [%t]\ %ft\ %b/%s\ %Tw/%Tc/%Tt\ %B\ %ts\ %ac/%fc/%bc/%sc/%rc\ %sq/%bq
mode tcp
maxconn 4000
stick-table type ip size 100k expire 30s store conn_rate(3s),conn_cur
acl ingress req_ssl_sni -i api.shop.domain1.suffix
acl ingress req_ssl_sni -i b2b.shop.domain1.suffix
tcp-request inspect-delay 5s
tcp-request connection accept if { src -f /etc/haproxy/ourservice-whitelist.lst }
tcp-request connection reject if { src_conn_rate ge 20 }
tcp-request connection reject if { src_conn_cur ge 30 }
tcp-request connection track-sc0 src
tcp-request content accept if { req_ssl_hello_type 1 }
use_backend kubernetes_ingress if ingress
use_backend static_ssl_prod_be if www_ssl_prod
#------------------
# backend instances
#------------------
# other backend blocks here, hidden
backend kubernetes_ingress
mode tcp
stick-table type binary len 32 size 30k expire 30m
acl clienthello req_ssl_hello_type 1
acl serverhello rep_ssl_hello_type 2
tcp-request inspect-delay 5s
tcp-request content accept if clienthello
tcp-response content accept if serverhello
stick on payload_lv(43,1) if clienthello
stick store-response payload_lv(43,1) if serverhello
server kube-node01 kubeip1:31443 check weight 100 send-proxy agent-check agent-port 8080
server kube-node02 kubeip2:31443 check weight 100 send-proxy agent-check agent-port 8080
server kube-node03 kubeip3:31443 check weight 100 send-proxy agent-check agent-port 8080
# Other backends here
在 kube-node01 上,服务 kube-proxy 正在运行。
我试图curl -vvv b2b.shop.domain1.suffix
从:
负载均衡器节点
kube0# 节点
kube-proxy 容器
但我只看到:
* Rebuilt URL to: b2b.shop.domain1.suffix/
* Trying publicip3...
* TCP_NODELAY set
* connect to publicip3 port 80 failed: Connection timed out
* Failed to connect to b2b.shop.domain1.suffix port 80: Connection timed out
* Closing connection 0
curl: (7) Failed to connect to b2b.shop.domain1.suffix port 80: Connection timed out
应该如何验证入口?
解决方案
推荐阅读
- amazon-web-services - AWS Athena 在 csv 文件中找不到任何记录
- c - 为什么程序挂在孩子与父母的沟通上?
- stm32 - 2 proteus中stm32地址不匹配
- ios - 试图从特定的崩溃日志中获取代码行
- swift - 即使我的数据库中只有一个,项目也会不断添加到 Tableview
- ios - 使用 firebase 实现聊天
- pandas - 如何根据 Pandas 数据框中的两个索引将多列值转换为一列
- html - Bootstrap 3 中的标签、类和属性
- java - org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError - Unirest
- javascript - 为什么在 if 语句中使用逻辑 AND 时会收到意外标记?