This commit is contained in:
@@ -8,7 +8,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
strategy:
|
strategy:
|
||||||
type: Recreate # MySQL requires Recreate since PVC is ReadWriteOnce
|
type: Recreate
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app.kubernetes.io/name: mysql
|
app.kubernetes.io/name: mysql
|
||||||
@@ -48,27 +48,94 @@ spec:
|
|||||||
memory: 1Gi
|
memory: 1Gi
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
exec:
|
exec:
|
||||||
command:
|
command: ["mysqladmin", "ping", "-h", "localhost"]
|
||||||
- mysqladmin
|
initialDelaySeconds: 90 # was 30 — must survive full init
|
||||||
- ping
|
periodSeconds: 15
|
||||||
- -h
|
|
||||||
- localhost
|
|
||||||
initialDelaySeconds: 30
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
timeoutSeconds: 5
|
||||||
failureThreshold: 3
|
failureThreshold: 3
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
exec:
|
exec:
|
||||||
command:
|
command: ["mysqladmin", "ping", "-h", "localhost"]
|
||||||
- mysqladmin
|
initialDelaySeconds: 60 # was 10 — critical fix
|
||||||
- ping
|
periodSeconds: 10
|
||||||
- -h
|
timeoutSeconds: 5
|
||||||
- localhost
|
|
||||||
initialDelaySeconds: 10
|
|
||||||
periodSeconds: 5
|
|
||||||
timeoutSeconds: 3
|
|
||||||
failureThreshold: 5
|
failureThreshold: 5
|
||||||
volumes:
|
volumes:
|
||||||
- name: mysql-data
|
- name: mysql-data
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: mysql-data-pvc
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user