From 899509802cd0a17d29039bb25f4b9567d3d5ebaf Mon Sep 17 00:00:00 2001 From: subodh Date: Sun, 22 Feb 2026 11:41:16 +0000 Subject: [PATCH] patch --- k8s/base/mysql/deployment.yaml | 99 ++++++++++++++++++++++++++++------ 1 file changed, 83 insertions(+), 16 deletions(-) diff --git a/k8s/base/mysql/deployment.yaml b/k8s/base/mysql/deployment.yaml index 8daecd7..1dd5230 100644 --- a/k8s/base/mysql/deployment.yaml +++ b/k8s/base/mysql/deployment.yaml @@ -8,7 +8,7 @@ metadata: spec: replicas: 1 strategy: - type: Recreate # MySQL requires Recreate since PVC is ReadWriteOnce + type: Recreate selector: matchLabels: app.kubernetes.io/name: mysql @@ -48,27 +48,94 @@ spec: memory: 1Gi livenessProbe: exec: - command: - - mysqladmin - - ping - - -h - - localhost - initialDelaySeconds: 30 - periodSeconds: 10 + command: ["mysqladmin", "ping", "-h", "localhost"] + initialDelaySeconds: 90 # was 30 — must survive full init + periodSeconds: 15 timeoutSeconds: 5 failureThreshold: 3 readinessProbe: exec: - command: - - mysqladmin - - ping - - -h - - localhost - initialDelaySeconds: 10 - periodSeconds: 5 - timeoutSeconds: 3 + command: ["mysqladmin", "ping", "-h", "localhost"] + initialDelaySeconds: 60 # was 10 — critical fix + periodSeconds: 10 + timeoutSeconds: 5 failureThreshold: 5 volumes: - name: mysql-data persistentVolumeClaim: claimName: mysql-data-pvc + +# apiVersion: apps/v1 +# kind: Deployment +# metadata: +# name: mysql +# labels: +# app.kubernetes.io/name: mysql +# app.kubernetes.io/component: database +# spec: +# replicas: 1 +# strategy: +# type: Recreate # MySQL requires Recreate since PVC is ReadWriteOnce +# selector: +# matchLabels: +# app.kubernetes.io/name: mysql +# app.kubernetes.io/component: database +# template: +# metadata: +# labels: +# app.kubernetes.io/name: mysql +# app.kubernetes.io/component: database +# spec: +# containers: +# - name: mysql +# image: mysql:8.0 +# ports: +# - containerPort: 3306 +# name: mysql +# env: +# - name: MYSQL_ROOT_PASSWORD +# valueFrom: +# secretKeyRef: +# name: mysql-secret +# key: MYSQL_ROOT_PASSWORD +# - name: MYSQL_DATABASE +# valueFrom: +# secretKeyRef: +# name: mysql-secret +# key: DB_NAME +# volumeMounts: +# - name: mysql-data +# mountPath: /var/lib/mysql +# resources: +# requests: +# cpu: 250m +# memory: 512Mi +# limits: +# cpu: "1" +# memory: 1Gi +# livenessProbe: +# exec: +# command: +# - mysqladmin +# - ping +# - -h +# - localhost +# initialDelaySeconds: 30 +# periodSeconds: 10 +# timeoutSeconds: 5 +# failureThreshold: 3 +# readinessProbe: +# exec: +# command: +# - mysqladmin +# - ping +# - -h +# - localhost +# initialDelaySeconds: 10 +# periodSeconds: 5 +# timeoutSeconds: 3 +# failureThreshold: 5 +# volumes: +# - name: mysql-data +# persistentVolumeClaim: +# claimName: mysql-data-pvc