From 61137a11b82cd8e70174e5f351a7b6bfa4414dbb Mon Sep 17 00:00:00 2001 From: maonamao <2582480639@qq.com> Date: Sat, 27 Dec 2025 13:42:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dmysql=E9=95=9C=E5=83=8F?= =?UTF-8?q?=E6=8B=89=E5=8F=96=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci-cd.yml | 4 ++-- k8s/ecommerce/05-mysql-statefulset.yml | 2 +- k8s/ecommerce/11-backend-blue-deployment.yml | 7 +++++++ k8s/ecommerce/12-backend-green-deployment.yml | 7 +++++++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index a1ce826..d0153ee 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -179,9 +179,9 @@ jobs: $KUBECTL -n ecommerce set image deployment/backend-$INACTIVE_TRACK \ backend=$REGISTRY/backend:$TAG - $KUBECTL -n ecommerce rollout status deployment/backend-$INACTIVE_TRACK --timeout=120s + $KUBECTL -n ecommerce rollout status deployment/backend-$INACTIVE_TRACK --timeout=10m $KUBECTL -n ecommerce patch svc backend \ -p '{"spec":{"selector":{"app":"backend","track":"'"$INACTIVE_TRACK"'"}}}' - $KUBECTL -n ecommerce rollout status deployment/frontend --timeout=120s \ No newline at end of file + $KUBECTL -n ecommerce rollout status deployment/frontend --timeout=10m \ No newline at end of file diff --git a/k8s/ecommerce/05-mysql-statefulset.yml b/k8s/ecommerce/05-mysql-statefulset.yml index c72d2cc..b909c1b 100644 --- a/k8s/ecommerce/05-mysql-statefulset.yml +++ b/k8s/ecommerce/05-mysql-statefulset.yml @@ -16,7 +16,7 @@ spec: spec: containers: - name: mysql - image: mysql:8.0 + image: registry.cn-hangzhou.aliyuncs.com/library/mysql:8.0 ports: - name: mysql containerPort: 3306 diff --git a/k8s/ecommerce/11-backend-blue-deployment.yml b/k8s/ecommerce/11-backend-blue-deployment.yml index 9f828b7..c2733a5 100644 --- a/k8s/ecommerce/11-backend-blue-deployment.yml +++ b/k8s/ecommerce/11-backend-blue-deployment.yml @@ -41,6 +41,13 @@ spec: secretKeyRef: name: mysql-secret key: MYSQL_PASSWORD + startupProbe: + httpGet: + path: /actuator/health + port: 8080 + periodSeconds: 5 + timeoutSeconds: 3 + failureThreshold: 60 readinessProbe: httpGet: path: /actuator/health diff --git a/k8s/ecommerce/12-backend-green-deployment.yml b/k8s/ecommerce/12-backend-green-deployment.yml index 780a6a1..771dc0a 100644 --- a/k8s/ecommerce/12-backend-green-deployment.yml +++ b/k8s/ecommerce/12-backend-green-deployment.yml @@ -41,6 +41,13 @@ spec: secretKeyRef: name: mysql-secret key: MYSQL_PASSWORD + startupProbe: + httpGet: + path: /actuator/health + port: 8080 + periodSeconds: 5 + timeoutSeconds: 3 + failureThreshold: 60 readinessProbe: httpGet: path: /actuator/health