Some checks failed
scrum-manager/pipeline/head There was a failure building this commit
142 lines
3.9 KiB
YAML
142 lines
3.9 KiB
YAML
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
|
|
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: 90 # was 30 — must survive full init
|
|
periodSeconds: 15
|
|
timeoutSeconds: 5
|
|
failureThreshold: 3
|
|
readinessProbe:
|
|
exec:
|
|
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
|