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 数据运维:定位、热备份、跨节点迁移、卸载保留、常见坑
This commit is contained in:
1 parent
9f7c522157
commit
9a46a955d4
5 files changed
+704
-26
No files matched your search
@@ -0,0 +1,14 @@
|
||||
# 只做模板:不要提交真实密钥。
|
||||
# 推荐直接用命令创建(避免密钥落盘到 Git):
|
||||
# kubectl -n log create secret generic opsxloki-secrets \
|
||||
# --from-literal=JWT_SECRET="$(openssl rand -hex 32)" \
|
||||
# --from-literal=ENCRYPTION_KEY="$(openssl rand -hex 32)"
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: opsxloki-secrets
|
||||
namespace: log
|
||||
type: Opaque
|
||||
stringData:
|
||||
JWT_SECRET: "REPLACE_WITH_32_BYTES_HEX"
|
||||
ENCRYPTION_KEY: "REPLACE_WITH_32_BYTES_HEX"
|
||||
Reference in new issue
Block a user