chore: 移除 Jenkinsfile,新增 deploy/ 目录部署配置

- 移除不符合团队规范的 Jenkinsfile
- 新增 deploy/deployment.yaml(SWR 镜像、副本数1、私有镜像拉取 secrets)
- 新增 deploy/service.yaml(80 端口转发到容器 3000 端口)
- 新增 deploy/ingress.yaml(域名 personal.virtheart.com,Traefik + cert-manager)
- docker-compose.yml 改为使用 SWR 镜像,保证本地与生产一致
- README 更新部署说明
This commit is contained in:
2026-08-04 05:56:45 +08:00
parent 4fcaa5662d
commit a661db1dca
7 changed files with 189 additions and 76 deletions
+57
View File
@@ -0,0 +1,57 @@
# Arcticnewone 生产部署配置
本目录存放 Arcticnewone 个人网站的 Kubernetes 生产部署配置(华为云 SWR 镜像 + Traefik Ingress)。
## 文件说明
| 文件 | 说明 |
| --- | --- |
| `deployment.yaml` | DeploymentSWR 镜像、副本数 1、私有镜像拉取 secrets |
| `service.yaml` | ServiceClusterIP80 端口转发到容器 3000 端口 |
| `ingress.yaml` | Ingress:域名 `personal.virtheart.com`Traefik + cert-manager 自动签发证书 |
## 部署前置条件
1. 镜像已构建并推送到华为云 SWR
`swr.cn-north-4.myhuaweicloud.com/virtheart/arcticnewone:latest`(多架构 `linux/amd64,linux/arm64`tag 统一为 `latest`
2. 集群已安装 Traefik Ingress 与 cert-managerClusterIssuer 名称为 `lets-encrypt`
3. 域名 `personal.virtheart.com` 的 DNS 已解析到集群入口
4. 创建私有镜像拉取 Secret(凭据从环境变量读取,绝不写入仓库):
```bash
kubectl create secret docker-registry huawei-swr-secret \
--docker-server="$SWR_REGISTRY" \
--docker-username="$SWR_USERNAME" \
--docker-password="$SWR_PASSWORD" \
--dry-run=client -o yaml | kubectl apply -f -
```
## 部署步骤
```bash
kubectl apply -f deploy/deployment.yaml
kubectl apply -f deploy/service.yaml
kubectl apply -f deploy/ingress.yaml
```
部署后验证:
```bash
kubectl get deploy,svc,ingress
kubectl rollout status deployment/arcticnewone
curl -I https://personal.virtheart.com
```
## 回滚方案
镜像 tag 固定为 `latest`,回滚前先确认 SWR 上 `latest` 对应可回滚的版本(或先推送目标版本镜像),再执行:
```bash
# 回滚到上一版本镜像
kubectl rollout undo deployment/arcticnewone
# 或整体移除本次部署的资源
kubectl delete -f deploy/ingress.yaml
kubectl delete -f deploy/service.yaml
kubectl delete -f deploy/deployment.yaml
```