main:新增 Kubernetes 部署配置及文档

变更内容:
- 添加 Kubernetes 部署配置文件,包括 API Deployment、Worker Deployment 和 Redis Deployment。
- 新增 Service 定义,支持 API、Metrics 和 Redis 的集群访问。
- 配置 ConfigMap,用于全局共享环境变量。
- 编写 Kubernetes 部署指南文档,包含快速部署步骤、建议配置及故障排查方法。
- 提升系统的可扩展性和容器编排能力,适配生产环境使用。
This commit is contained in:
2026-02-03 16:30:48 +08:00
parent b77e736790
commit c7626723a3
5 changed files with 502 additions and 247 deletions

View File

@@ -1,9 +1,15 @@
# Kubernetes Service 配置
# 包含API Service、Metrics Service、Redis Service
---
# API Service - 对外暴露 HTTP 服务
apiVersion: v1
kind: Service
metadata:
name: functional-scaffold
name: functional-scaffold-api
labels:
app: functional-scaffold
component: api
spec:
type: ClusterIP
ports:
@@ -13,13 +19,21 @@ spec:
name: http
selector:
app: functional-scaffold
component: api
---
# Metrics Service - Prometheus 抓取指标
apiVersion: v1
kind: Service
metadata:
name: functional-scaffold-metrics
labels:
app: functional-scaffold
component: api
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "8000"
prometheus.io/path: "/metrics"
spec:
type: ClusterIP
ports:
@@ -29,3 +43,24 @@ spec:
name: metrics
selector:
app: functional-scaffold
component: api
---
# Redis Service - 内部 Redis 服务
apiVersion: v1
kind: Service
metadata:
name: functional-scaffold-redis
labels:
app: functional-scaffold
component: redis
spec:
type: ClusterIP
ports:
- port: 6379
targetPort: 6379
protocol: TCP
name: redis
selector:
app: functional-scaffold
component: redis