Use deployment patch for session dev scaling
This commit is contained in:
Vendored
+2
-2
@@ -150,7 +150,7 @@ spec:
|
|||||||
sh """
|
sh """
|
||||||
set -eux
|
set -eux
|
||||||
if [ "${IS_SESSION_JOB}" = "true" ]; then
|
if [ "${IS_SESSION_JOB}" = "true" ]; then
|
||||||
kubectl -n ${APP_NS} scale deploy/${DEPLOY} --replicas=0
|
kubectl -n ${APP_NS} patch deploy ${DEPLOY} --type=merge -p '{"spec":{"replicas":0}}'
|
||||||
for i in \$(seq 1 150); do
|
for i in \$(seq 1 150); do
|
||||||
POD_COUNT=\$(kubectl -n ${APP_NS} get pod -l app=${DEPLOY} --no-headers 2>/dev/null | wc -l | tr -d ' ')
|
POD_COUNT=\$(kubectl -n ${APP_NS} get pod -l app=${DEPLOY} --no-headers 2>/dev/null | wc -l | tr -d ' ')
|
||||||
[ "\${POD_COUNT}" = "0" ] && break
|
[ "\${POD_COUNT}" = "0" ] && break
|
||||||
@@ -165,7 +165,7 @@ spec:
|
|||||||
kubectl -n ${APP_NS} set image deploy/${DEPLOY} ${DEPLOY}=${REG}/${IMAGE}:${IMAGE_TAG}
|
kubectl -n ${APP_NS} set image deploy/${DEPLOY} ${DEPLOY}=${REG}/${IMAGE}:${IMAGE_TAG}
|
||||||
|
|
||||||
if [ "${IS_SESSION_JOB}" = "true" ]; then
|
if [ "${IS_SESSION_JOB}" = "true" ]; then
|
||||||
kubectl -n ${APP_NS} scale deploy/${DEPLOY} --replicas=1
|
kubectl -n ${APP_NS} patch deploy ${DEPLOY} --type=merge -p '{"spec":{"replicas":1}}'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
kubectl -n ${APP_NS} rollout status deploy/${DEPLOY} --timeout=300s
|
kubectl -n ${APP_NS} rollout status deploy/${DEPLOY} --timeout=300s
|
||||||
|
|||||||
Reference in New Issue
Block a user