Files
LokiStack/kubernetes/examples/ingress-tke.yaml
T
opsx 9a46a955d4 feat(k8s): 一键部署脚本 + 跨云适配 + 云相关清单拆分到 examples
新增 kubernetes/install.sh(一条命令部署):
- 云平台识别:读节点 providerID,识别 TKE / EKS / ACK / CCE / GKE / AKS / K3s / 自建
- StorageClass 三级探测:显式 STORAGE_CLASS → is-default-class 注解 → 集群唯一 SC
- 自建集群兜底:无任何 SC 时自动创建静态 local PV
  (hostPath + DirectoryOrCreate + nodeAffinity + WaitForFirstConsumer + Retain)
- Secret 幂等生成:已存在则跳过,绝不覆盖(避免密钥轮换导致历史凭证无法解密)
- 失败分类诊断:ImagePullBackOff / CreateContainerConfigError / PVC Pending
  按云给出对应仓库格式与推荐 SC 名
- 环境变量:WITH_NODEPORT / STORAGE_CLASS / LOCAL_STORAGE / NODE_NAME / PV_PATH / PV_SIZE

云相关清单拆到 kubernetes/examples/:
- ingress.yaml(阿里云 alb)、ingress-tke.yaml(腾讯云 qcloud)、secret.example.yaml
- 原因:留在根目录会导致 kubectl apply -f kubernetes/ 时 ingress 同名互相覆盖,
  且 secret.example.yaml 的占位符会把真实密钥顶掉

README 重写:
- 全部用法速查 + 环境变量一览
- 自建 K8s 存储方案选型(local PV / local-path-provisioner / OpenEBS / Longhorn / NFS)
- hostPath 数据运维:定位、热备份、跨节点迁移、卸载保留、常见坑
2026-10-26 14:03:39 +00:00

34 lines
1.1 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.
# 腾讯云 TKE 专用 Ingress 模板
#
# 与官方 ingress.yaml 的区别:
# 官方用 alb(阿里云)→ TKE 不支持
# TKE 用 ingressClassName: qcloud,且后端 Service 必须是 NodePort 类型
#
# 使用前:
# 1) 先创建 NodePort Service:kubectl apply -f kubernetes/service-nodeport.yaml
# 2) 把下面 host 改成你要用的域名
# 3) kubectl apply -f kubernetes/ingress-tke.yaml
# 4) 在腾讯云控制台/DNS 把该域名解析到 CLB 的公网 IP
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: opsx-loki
namespace: log
annotations:
# CLB 健康检查(可选,TKE 默认会用 TCP 检查)
cloud.tencent.com/health-check-path: /api/v1/health
cloud.tencent.com/health-check-interval: "10"
spec:
ingressClassName: qcloud
rules:
- host: loki.astx.club # ← 改成你的域名
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: opsx-loki-nodeport # ← 必须是 NodePort 类型 Service
port:
number: 8080