Files
Deploy-Laboratory/ansible/files/03-04-cloudflare-tunnel/cloudflared.yaml
jack 8c43761962 feat: 按 doc_id 重组 ansible/files 与验证框架
- ansible/files 改为与文档 XX-YY 对齐的目录结构,更新相关 playbook 路径
- 新增 scripts/verify.sh 与 ansible/playbooks/verify/*.yml,移除单体 verify-matrix.yml
- 补充 docs/00-02 矩阵状态、00-05 验证框架与流程、00-04 环境与 ylc65 工作机说明
- 增加 k3s 存储准备、Longhorn、local-path 等 playbook 与辅助脚本

Made-with: Cursor
2026-03-26 07:01:14 +08:00

39 lines
1.9 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.
# docs/03-04-k3s-cloudflare-tunnel-配置接入.md — 替换 TUNNEL_TOKEN 后应用
apiVersion: v1 # Secret 使用的 Kubernetes API 版本
kind: Secret # 资源类型Secret用于保存 Cloudflare Tunnel token
metadata: # 元信息(名称/命名空间等)
name: cloudflared-credentials # Secret 名称Deployment 中会引用)
namespace: kube-system # Secret 所在命名空间
type: Opaque # Secret 类型(普通自定义键值)
stringData: # 以字符串方式提供 Secret 数据(便于直接写明文)
TUNNEL_TOKEN: "<YOUR_TUNNEL_TOKEN>" # Cloudflare Tunnel Token用你真实的 token 替换)
---
apiVersion: apps/v1 # Deployment 使用的 API 版本
kind: Deployment # 工作负载Deployment管理 Pod 副本)
metadata: # Deployment 元信息
name: cloudflared # Deployment 名称
namespace: kube-system # 部署到的命名空间
spec: # Deployment 期望状态
replicas: 1 # 副本数Tunnel 通常只跑一个副本即可)
selector: # Deployment 选择器:匹配 template 的 Pod
matchLabels: # 必须与 template.metadata.labels 对齐
app: cloudflared # 应用标签
template: # Pod 模板
metadata: # Pod 元信息
labels: # Pod 标签
app: cloudflared # 与 selector.matchLabels 相同
spec: # Pod 规范
containers: # 容器列表
- name: cloudflared # 容器名
image: cloudflare/cloudflared:latest # cloudflared 镜像
args: # 容器启动参数
- tunnel # 命令子参数tunnel
- run # 命令子参数run
env: # 环境变量
- name: TUNNEL_TOKEN # 容器内使用的环境变量名
valueFrom: # 从某个来源取值
secretKeyRef: # 从 Secret 的 key 取值
name: cloudflared-credentials # Secret 名称
key: TUNNEL_TOKEN # Secret 中的 key