Files
Deploy-Laboratory/ansible/files/traefik-dashboard/traefik-dashboard.yaml
jack be97836e0d chore: 清理调试脚本并收敛到 Ansible 流程
移除已废弃的调试/验证脚本与空目录,统一文档与脚本说明到 ansible-playbook 的部署方式,避免失效引用和误用路径。

Made-with: Cursor
2026-03-23 19:18:55 +08:00

38 lines
1.8 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 03-01 Traefik DashboardHelmChartConfig + IngressRoute
# 部署kubectl apply -f traefik-dashboard.yaml或复制到 K3s server/manifests/
---
apiVersion: helm.cattle.io/v1 # HelmChartConfig 所在的 API 版本
kind: HelmChartConfig # HelmChartConfig给 K3s/Traefik chart 注入 values
metadata: # 该资源标识
name: traefik # chart 对应的对象名
namespace: kube-system # HelmChartConfig 所在命名空间
spec: # Helm 注入配置
valuesContent: |- # 以“字符串形式的 YAML”注入到 chart values由 chart 解析)
ports: # entrypoint/端口暴露相关配置
web: # HTTP entrypoint
expose: true # 启用 web 暴露
websecure: # HTTPS entrypoint
expose: true # 启用 websecure 暴露
traefik: #chart 内部traefik dashboard/管理端口暴露(按 chart 约定)
expose: true # 启用 traefik 管理端口暴露
additionalArguments: # 额外传给 Traefik 的 CLI 参数
- "--api.dashboard=true" # 开启 dashboard 功能
- "--api.insecure=true" # 允许 dashboard 在入口可用(不建议在公网直接放行)
---
apiVersion: traefik.io/v1alpha1 # IngressRoute 的 API 版本
kind: IngressRoute # Traefik 的路由 CRD
metadata: # IngressRoute 标识
name: traefik-dashboard # 资源名
namespace: kube-system # IngressRoute 所在命名空间
spec: # 路由规则
entryPoints: # 进入的 entrypoint
- web # 使用 webHTTP入口
routes: # 路由列表
- match: PathPrefix(`/dashboard`) || PathPrefix(`/api`) # 匹配 /dashboard 或 /api 前缀
kind: Rule # 匹配规则类型Rule
services: # 匹配到后转发给的服务列表
- name: api@internal # Traefik 内置 API 服务
kind: TraefikService # 该服务的 CRD 类型