chore: 新增 namespace.yaml 并更新部署步骤

This commit is contained in:
2026-08-04 06:13:01 +08:00
parent 07c9448f41
commit 40faf4a4c9
2 changed files with 15 additions and 4 deletions
+5 -4
View File
@@ -6,11 +6,12 @@
| 文件 | 说明 | | 文件 | 说明 |
| --- | --- | | --- | --- |
| `namespace.yaml` | Namespace:项目专属命名空间 `arcticnewone` |
| `deployment.yaml` | DeploymentSWR 镜像、副本数 1、私有镜像拉取 secrets | | `deployment.yaml` | DeploymentSWR 镜像、副本数 1、私有镜像拉取 secrets |
| `service.yaml` | ServiceClusterIP80 端口转发到容器 3000 端口 | | `service.yaml` | ServiceClusterIP80 端口转发到容器 3000 端口 |
| `ingress.yaml` | Ingress:域名 `personal.virtheart.com`Traefik + cert-manager 自动签发证书 | | `ingress.yaml` | Ingress:域名 `personal.virtheart.com`Traefik + cert-manager 自动签发证书 |
三个 YAML 的 `metadata` 均已指定 `namespace: arcticnewone` `namespace.yaml` 负责创建 `arcticnewone` 命名空间;deployment/service/ingress 三个 YAML 的 `metadata` 均已指定 `namespace: arcticnewone`
## 部署前置条件 ## 部署前置条件
@@ -18,10 +19,9 @@
`swr.cn-north-4.myhuaweicloud.com/virtheart/arcticnewone:latest`(多架构 `linux/amd64,linux/arm64`tag 统一为 `latest` `swr.cn-north-4.myhuaweicloud.com/virtheart/arcticnewone:latest`(多架构 `linux/amd64,linux/arm64`tag 统一为 `latest`
2. 集群已安装 Traefik Ingress 与 cert-managerClusterIssuer 名称为 `lets-encrypt` 2. 集群已安装 Traefik Ingress 与 cert-managerClusterIssuer 名称为 `lets-encrypt`
3. 域名 `personal.virtheart.com` 的 DNS 已解析到集群入口 3. 域名 `personal.virtheart.com` 的 DNS 已解析到集群入口
4. 创建命名空间与私有镜像拉取 Secret(凭据从环境变量读取,绝不写入仓库): 4. 创建私有镜像拉取 Secret(凭据从环境变量读取,绝不写入仓库;命名空间由 `namespace.yaml` 创建):
```bash ```bash
kubectl create namespace arcticnewone
kubectl create secret docker-registry huawei-swr-secret -n arcticnewone \ kubectl create secret docker-registry huawei-swr-secret -n arcticnewone \
--docker-server="$SWR_REGISTRY" \ --docker-server="$SWR_REGISTRY" \
--docker-username="$SWR_USERNAME" \ --docker-username="$SWR_USERNAME" \
@@ -32,12 +32,13 @@
## 部署步骤 ## 部署步骤
```bash ```bash
kubectl apply -f deploy/namespace.yaml
kubectl apply -f deploy/deployment.yaml kubectl apply -f deploy/deployment.yaml
kubectl apply -f deploy/service.yaml kubectl apply -f deploy/service.yaml
kubectl apply -f deploy/ingress.yaml kubectl apply -f deploy/ingress.yaml
``` ```
三个 YAML 自带 `namespace: arcticnewone``kubectl apply` 时无需额外指定。 `namespace.yaml` 需最先应用;其余三个 YAML 自带 `namespace: arcticnewone``kubectl apply` 时无需额外指定。
部署后验证: 部署后验证:
+10
View File
@@ -0,0 +1,10 @@
# =========================================================
# Arcticnewone 生产部署 - Namespace
#
# 项目专属命名空间,Deployment/Service/Ingress 等资源统一部署于此。
# 部署时需最先应用本文件,再应用其他资源。
# =========================================================
apiVersion: v1
kind: Namespace
metadata:
name: arcticnewone