diff --git a/Jenkinsfile b/Jenkinsfile index 16dd557..1208721 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -137,16 +137,14 @@ pipeline { // Show pod state immediately after apply so we can see pull/init status in logs sh "kubectl get pods -n scrum-manager -o wide" - // MySQL uses Recreate strategy: old pod terminates (~30s) before - // new pod starts. Readiness probe initialDelaySeconds=30 + up to - // 10 retries × 5s = 80s. Total worst-case: ~110s → 300s is safe. + // MySQL uses Recreate strategy: old pod terminates then new starts. sh "kubectl rollout status deployment/mysql -n scrum-manager --timeout=300s" - // Backend initContainer sleeps 15s after MySQL TCP is up before - // starting the Node process. 512Mi memory limit avoids OOMKill. - sh "kubectl rollout status deployment/backend -n scrum-manager --timeout=300s" + // maxSurge=0: old pod terminates first, new pod starts after. + // CPU-constrained nodes may delay scheduling — 600s covers this. + sh "kubectl rollout status deployment/backend -n scrum-manager --timeout=600s" - sh "kubectl rollout status deployment/frontend -n scrum-manager --timeout=180s" + sh "kubectl rollout status deployment/frontend -n scrum-manager --timeout=600s" echo "All deployments rolled out." } diff --git a/k8s/base/backend/deployment.yaml b/k8s/base/backend/deployment.yaml index 1d6b3eb..bf11394 100644 --- a/k8s/base/backend/deployment.yaml +++ b/k8s/base/backend/deployment.yaml @@ -7,6 +7,11 @@ metadata: app.kubernetes.io/component: api spec: replicas: 2 + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 0 # Don't create extra pods during update — avoids CPU pressure + maxUnavailable: 1 # Terminate one old pod first, then start new one selector: matchLabels: app.kubernetes.io/name: backend diff --git a/k8s/base/frontend/deployment.yaml b/k8s/base/frontend/deployment.yaml index f435d99..4c59fe3 100644 --- a/k8s/base/frontend/deployment.yaml +++ b/k8s/base/frontend/deployment.yaml @@ -7,6 +7,11 @@ metadata: app.kubernetes.io/component: web spec: replicas: 2 + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 0 # Don't create extra pods during update — avoids CPU pressure + maxUnavailable: 1 # Terminate one old pod first, then start new one selector: matchLabels: app.kubernetes.io/name: frontend