fix: 限制单节点预发布的滚动更新并发
continuous-integration/drone/push Build was killed Details
continuous-integration/drone/tag Build is passing Details

This commit is contained in:
dongjf 2026-11-25 20:49:34 +08:00
parent c2e7821255
commit 100fb4c1a7
6 changed files with 15 additions and 4 deletions

View File

@ -115,7 +115,6 @@ steps:
environment: environment:
HELM_DRIVER: configmap HELM_DRIVER: configmap
ATLAS_OTLP_TRACES_ENDPOINT: http://atlas-alloy.item-atlas-observability.svc:4318/v1/traces ATLAS_OTLP_TRACES_ENDPOINT: http://atlas-alloy.item-atlas-observability.svc:4318/v1/traces
ATLAS_MEDIA_SECRET: atlas-media-client
ATLAS_KUBECONFIG_B64: ATLAS_KUBECONFIG_B64:
from_secret: atlas_staging_kubeconfig_b64 from_secret: atlas_staging_kubeconfig_b64
commands: commands:

View File

@ -22,6 +22,11 @@ metadata:
app.kubernetes.io/instance: {{ $root.Release.Name }} app.kubernetes.io/instance: {{ $root.Release.Name }}
spec: spec:
replicas: 1 replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: {{ $root.Values.rollout.maxSurge }}
maxUnavailable: {{ $root.Values.rollout.maxUnavailable }}
revisionHistoryLimit: 5 revisionHistoryLimit: 5
progressDeadlineSeconds: 660 progressDeadlineSeconds: 660
selector: selector:

View File

@ -7,6 +7,9 @@ profile: release
inventorySecret: item-atlas-inventory inventorySecret: item-atlas-inventory
intakeSecret: item-atlas-intake intakeSecret: item-atlas-intake
mediaSecret: "" mediaSecret: ""
rollout:
maxSurge: 1
maxUnavailable: 0
observability: observability:
otlpTracesEndpoint: "" otlpTracesEndpoint: ""
traceSampleRate: 0.1 traceSampleRate: 0.1

View File

@ -16,8 +16,8 @@ set -- helm upgrade --install item-atlas deploy/helm/item-atlas --namespace "$na
--atomic --wait --timeout 12m --history-max 10 \ --atomic --wait --timeout 12m --history-max 10 \
--set-string "image.tag=$DRONE_COMMIT_SHA" \ --set-string "image.tag=$DRONE_COMMIT_SHA" \
--set 'imagePullSecrets[0].name=item-atlas-registry' --set 'imagePullSecrets[0].name=item-atlas-registry'
if [ -n "${ATLAS_MEDIA_SECRET:-}" ]; then if [ "$namespace" = item-atlas-staging ]; then
set -- "$@" --set-string "mediaSecret=$ATLAS_MEDIA_SECRET" set -- "$@" --values deploy/helm/staging-values.yaml
fi fi
if [ -n "${ATLAS_OTLP_TRACES_ENDPOINT:-}" ]; then if [ -n "${ATLAS_OTLP_TRACES_ENDPOINT:-}" ]; then
set -- "$@" --set-string "observability.otlpTracesEndpoint=$ATLAS_OTLP_TRACES_ENDPOINT" set -- "$@" --set-string "observability.otlpTracesEndpoint=$ATLAS_OTLP_TRACES_ENDPOINT"

View File

@ -0,0 +1,4 @@
mediaSecret: atlas-media-client
rollout:
maxSurge: 0
maxUnavailable: 1

View File

@ -47,4 +47,4 @@ Flyway V4 为增量迁移。灰度前先让稳定版完成迁移,再启用读
## 预发布 Garage ## 预发布 Garage
`deploy/staging/garage.yaml` 只用于可信网络内的预发布命名空间。先在同一命名空间准备 Secret。`atlas-media-config` 包含 `garage.toml`,设置 `/store/meta`、`/store/data`、SQLite、单节点模式、内部 RPC 和 `garage` 签名 region。`atlas-media-bootstrap` 包含 Garage 的 `GARAGE_DEFAULT_ACCESS_KEY`、`GARAGE_DEFAULT_SECRET_KEY`、`GARAGE_DEFAULT_BUCKET`,首次启动使用。建立独立 PVC 后,确认其实际宿主盘为外置 SSD。创建 `atlas-media-client`,按上表配置,只放物品服务需要的连接信息,端点为 `http://atlas-media:3900`。预发布提升通过 Helm 的 `mediaSecret` 引用它。发布后先在测试空间上传,再验证删除两份对象。保留 Garage PVC 和配置备份,不通过重建 Secret 切换现有存储的密钥。 `deploy/staging/garage.yaml` 只用于可信网络内的预发布命名空间。先在同一命名空间准备 Secret。`atlas-media-config` 包含 `garage.toml`,设置 `/store/meta`、`/store/data`、SQLite、单节点模式、内部 RPC 和 `garage` 签名 region。`atlas-media-bootstrap` 包含 Garage 的 `GARAGE_DEFAULT_ACCESS_KEY`、`GARAGE_DEFAULT_SECRET_KEY`、`GARAGE_DEFAULT_BUCKET`,首次启动使用。建立独立 PVC 后,确认其实际宿主盘为外置 SSD。创建 `atlas-media-client`,按上表配置,只放物品服务需要的连接信息,端点为 `http://atlas-media:3900`。预发布提升通过 `deploy/helm/staging-values.yaml` 的 `mediaSecret` 引用它。发布后先在测试空间上传,再验证删除两份对象。保留 Garage PVC 和配置备份,不通过重建 Secret 切换现有存储的密钥。单节点预发布如果同时运行新旧 Pod 导致探针反复超时,预发布 values 用 `rollout.maxSurge=0`、`rollout.maxUnavailable=1` 滚动更换,避免单节点同时运行新旧 Pod。更新期间对应服务会短暂不可用。