chore(deploy): 删除废弃 nginx 配置并更新部署文档
- 移除 deploy/nginx/(旧前后端分离方案已无引用) - 重写 deploy/README.md 对齐 embed 三种部署方式 - 更新 deploy/kubernetes/README.md(lghost/aiops 镜像与 release 命令)
This commit is contained in:
1 parent
9215cd9b8c
commit
aac15122e5
3 files changed
+92
-139
No files matched your search
+17
-14
@@ -54,46 +54,48 @@ AIOps 平台在 Kubernetes 上的部署清单(Go/Gin 后端 + go:embed 前端
|
||||
# 查看日志
|
||||
./run.sh kubernetes logs
|
||||
|
||||
# 更新(重新构建镜像 + 滚动更新)
|
||||
./run.sh kubernetes upgrade
|
||||
# 指定版本滚动更新
|
||||
./run.sh kubernetes upgrade v1.5.0
|
||||
|
||||
# 构建并推送 Docker Hub
|
||||
./run.sh kubernetes push v1.5.0
|
||||
|
||||
# 清理
|
||||
./run.sh kubernetes delete
|
||||
```
|
||||
|
||||
镜像仓库:`lghost/aiops:<tag>`(由 `./run.sh release` 或 `kubernetes build` 构建注入版本号)。
|
||||
|
||||
### 方式二:手动 kubectl
|
||||
|
||||
```bash
|
||||
cd deploy/kubernetes
|
||||
|
||||
# 1. 全量部署(文件按序: namespace → secret → configmap → mysql → redis → deployment)
|
||||
kubectl apply -f namespace.yaml
|
||||
kubectl apply -f secret.yaml
|
||||
kubectl apply -f configmap.yaml
|
||||
kubectl apply -f pvc-aiops-data.yaml
|
||||
kubectl apply -f mysql.yaml
|
||||
kubectl apply -f redis.yaml
|
||||
|
||||
# 2. 等待数据库就绪
|
||||
kubectl -n devops rollout status statefulset/mysql
|
||||
kubectl -n devops rollout status statefulset/redis
|
||||
|
||||
# 3. 构建镜像(在本地)
|
||||
# 构建镜像(Mac/Linux 均可,按 TARGETARCH 自动选架构)
|
||||
cd ../..
|
||||
docker build -f Dockerfile.embed -t aiops:embed .
|
||||
./run.sh kubernetes build v1.5.0
|
||||
|
||||
# 4. 部署应用
|
||||
kubectl apply -f deployment.yaml
|
||||
kubectl apply -f deploy/kubernetes/deployment.yaml
|
||||
kubectl -n devops rollout status deployment/aiops
|
||||
|
||||
# 5. Ingress(按需修改 host)
|
||||
kubectl apply -f ingress.yaml
|
||||
kubectl apply -f deploy/kubernetes/ingress.yaml # 可选
|
||||
```
|
||||
|
||||
## 访问
|
||||
|
||||
```bash
|
||||
# NodePort 方式
|
||||
curl http://<NODE_IP>:30080/health
|
||||
# NodePort 方式(推荐 /version,无 DB 强依赖)
|
||||
curl http://<NODE_IP>:30080/version
|
||||
|
||||
# 或配置 Ingress host
|
||||
echo "<INGRESS_IP> aiops.local" | sudo tee -a /etc/hosts
|
||||
@@ -115,8 +117,9 @@ kubectl -n devops exec -it deployment/aiops -- bash
|
||||
# 进入 MySQL
|
||||
kubectl -n devops exec -it mysql-0 -- mysql -uaiops -paiops_pass_2026 aiops
|
||||
|
||||
# 滚动更新(重新构建镜像后)
|
||||
kubectl -n devops rollout restart deployment/aiops
|
||||
# 滚动更新(换镜像 tag 后)
|
||||
kubectl -n devops set image deployment/aiops aiops=lghost/aiops:v1.5.0 --record
|
||||
kubectl -n devops rollout status deployment/aiops
|
||||
|
||||
# 查看 PVC
|
||||
kubectl -n devops get pvc
|
||||
|
||||
Reference in new issue
Block a user