From c64cd4ca8bac98cbf8548ae991fe6e6fe1744725 Mon Sep 17 00:00:00 2001 From: Sergey Antropoff Date: Tue, 28 Jul 2026 00:56:46 +0300 Subject: [PATCH] Raise deploy rollout timeout to 1200s and set images in one step. Avoid double ReplicaSet churn and ImagePullBackOff races during Hub pulls. --- Jenkinsfile | 16 +++++++--------- docs/ci-cd.md | 3 ++- docs/ru/ci-cd.md | 3 ++- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 01b6511..2f1d550 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -135,7 +135,7 @@ pipeline { chmod +x /usr/local/bin/kubectl fi - kubectl version --client --short || kubectl version --client + kubectl version --client || true if ! kubectl -n "$HELM_NAMESPACE" get deploy "$DEPLOYMENT_NAME" >/dev/null 2>&1; then echo "Deployment ${HELM_NAMESPACE}/${DEPLOYMENT_NAME} not found." >&2 @@ -146,20 +146,18 @@ pipeline { echo "Rolling ${DOCKERHUB_IMAGE}:${IMAGE_VERSION} → ${HELM_NAMESPACE}/${DEPLOYMENT_NAME}" echo "Public URL: https://${INGRESS_HOST}/" - # Main container always; migrate initContainer when present. - kubectl -n "$HELM_NAMESPACE" set image \ - "deployment/${DEPLOYMENT_NAME}" \ - "simulator=${DOCKERHUB_IMAGE}:${IMAGE_VERSION}" + # One set-image avoids double ReplicaSet churn; migrate when present. + SET_ARGS=("simulator=${DOCKERHUB_IMAGE}:${IMAGE_VERSION}") if kubectl -n "$HELM_NAMESPACE" get deploy "$DEPLOYMENT_NAME" \ -o jsonpath='{.spec.template.spec.initContainers[*].name}' \ | tr ' ' '\n' | grep -qx migrate; then - kubectl -n "$HELM_NAMESPACE" set image \ - "deployment/${DEPLOYMENT_NAME}" \ - "migrate=${DOCKERHUB_IMAGE}:${IMAGE_VERSION}" + SET_ARGS+=("migrate=${DOCKERHUB_IMAGE}:${IMAGE_VERSION}") fi + kubectl -n "$HELM_NAMESPACE" set image \ + "deployment/${DEPLOYMENT_NAME}" "${SET_ARGS[@]}" kubectl -n "$HELM_NAMESPACE" rollout status \ - "deployment/${DEPLOYMENT_NAME}" --timeout=300s + "deployment/${DEPLOYMENT_NAME}" --timeout=1200s kubectl -n "$HELM_NAMESPACE" get deploy,po,ing -o wide ''' } diff --git a/docs/ci-cd.md b/docs/ci-cd.md index 3bf4817..cd45ab8 100644 --- a/docs/ci-cd.md +++ b/docs/ci-cd.md @@ -15,7 +15,8 @@ Single [`Jenkinsfile`](../Jenkinsfile) on `main` / `master`: 1. **Build & push** (agent `docker` / DinD) — multi-arch `linux/amd64,linux/arm64` to Harbor and Docker Hub with tags **`:{VERSION}`** and **`:latest`** only. 2. **Deploy** — `kubectl set image` on `simulators/simulators-proxmox` (main - container `simulator` + initContainer `migrate`), then rollout status. + container `simulator` + initContainer `migrate`), then rollout status + (`--timeout=1200s`). First cluster install (Ingress, Postgres, secrets) is **not** this job — use `make addon-simulators` in DevOpsTools/K3S (`simulators_proxmox_host: diff --git a/docs/ru/ci-cd.md b/docs/ru/ci-cd.md index 86d1a74..e37e2bb 100644 --- a/docs/ru/ci-cd.md +++ b/docs/ru/ci-cd.md @@ -15,7 +15,8 @@ Jenkins версию **не** поднимает — собирает то, чт 1. **Build & push** (agent `docker` / DinD) — multi-arch `linux/amd64,linux/arm64` в Harbor и Docker Hub, теги только **`:{VERSION}`** и **`:latest`**. 2. **Deploy** — `kubectl set image` для `simulators/simulators-proxmox` - (контейнер `simulator` + initContainer `migrate`), затем rollout status. + (контейнер `simulator` + initContainer `migrate`), затем rollout status + (`--timeout=1200s`). Первый install в кластере (Ingress, Postgres, секреты) — **не** этот job, а `make addon-simulators` в DevOpsTools/K3S (`simulators_proxmox_host: