chore: 新增 build-and-push.sh 镜像构建推送脚本并更新文档
This commit is contained in:
+18
-2
@@ -13,10 +13,26 @@
|
||||
|
||||
`namespace.yaml` 负责创建 `arcticnewone` 命名空间;deployment/service/ingress 三个 YAML 的 `metadata` 均已指定 `namespace: arcticnewone`。
|
||||
|
||||
## 镜像构建与推送
|
||||
|
||||
镜像由项目根目录的 `build-and-push.sh` 构建并推送到华为云 SWR(多架构 `linux/amd64,linux/arm64`,tag 统一为 `latest`):
|
||||
|
||||
```bash
|
||||
# 1. 设置环境变量(凭据绝不写入仓库)
|
||||
export SWR_REGISTRY="swr.cn-north-4.myhuaweicloud.com"
|
||||
export SWR_NAMESPACE="virtheart"
|
||||
export SWR_USERNAME="<用户名>"
|
||||
export SWR_PASSWORD="<密码>"
|
||||
|
||||
# 2. 执行构建与推送
|
||||
./build-and-push.sh
|
||||
```
|
||||
|
||||
推送完成后镜像地址:`swr.cn-north-4.myhuaweicloud.com/virtheart/arcticnewone:latest`。
|
||||
|
||||
## 部署前置条件
|
||||
|
||||
1. 镜像已构建并推送到华为云 SWR:
|
||||
`swr.cn-north-4.myhuaweicloud.com/virtheart/arcticnewone:latest`(多架构 `linux/amd64,linux/arm64`,tag 统一为 `latest`)
|
||||
1. 镜像已构建并推送到华为云 SWR(通过项目根目录 `./build-and-push.sh` 执行,见上方「镜像构建与推送」)
|
||||
2. 集群已安装 Traefik Ingress 与 cert-manager(ClusterIssuer 名称为 `lets-encrypt`)
|
||||
3. 域名 `personal.virtheart.com` 的 DNS 已解析到集群入口
|
||||
4. 创建私有镜像拉取 Secret(凭据从环境变量读取,绝不写入仓库;命名空间由 `namespace.yaml` 创建):
|
||||
|
||||
Reference in New Issue
Block a user