Lazy loaded image
k8s traefik TCP 负载均衡
Words 236Read Time 1 min
2025-10-10
2025-11-10
date
related_level
slug
k8s_traefik_haproxy
type
Post
relate_date
summary
通过 SNI 在 haproxy+keepalived 负载均衡中区分并转发至 traefik 与 nginx 后端
status
Published
tags
k8s
高可用
实用教程
category
互联网
last_updated
Nov 10, 2025 10:02 PM
是否已更新
orginal_page
是否推荐
参考资料
  • 假设已经参考其他文章搭建了 haproxy+keepalived 的负载均衡
haproxy 使用 sni 区分需要发送的后端
  • 假设 nginx 后端的 tls subject 域名为 example.internal, k3s 则为默认的 cluster.local
测试 haproxy 能否正确分流
添加 keepalived vip 到 DNS 记录
  • 假设 nginx 部署了 www.example.internal 页面, k3s 为 traefik 开启了面板并配置 host 为 traefik-dboard.traefik.cluster.local
    • k3s 开启内置 traefik 面板查看其他文章
  • openssl 测试
    • openssl s_client -connect <keepalived_vip>:443 -servername traefik-dboard.traefik.cluster.local | grep "subject="
    • openssl s_client -connect <keepalived_vip>:443 -servername www.example.internal | grep "subject="
 
上一篇
部署 Kubernetes Dashboard 访问 Kubernetes 仪表盘
下一篇
TrueNAS SCALE 系统管理

Comments
Loading...