72 lines
1.7 KiB
YAML
72 lines
1.7 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: mysql
|
|
namespace: lpt-dev
|
|
labels:
|
|
app: mysql
|
|
spec:
|
|
replicas: 1
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
app: mysql
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: mysql
|
|
spec:
|
|
terminationGracePeriodSeconds: 30
|
|
containers:
|
|
- name: mysql
|
|
image: mysql:9
|
|
imagePullPolicy: IfNotPresent
|
|
ports:
|
|
- containerPort: 3306
|
|
protocol: TCP
|
|
env:
|
|
- name: MYSQL_ROOT_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: lpt-secrets
|
|
key: mysql-root-password
|
|
- name: MYSQL_DATABASE
|
|
value: learning_progress_tracker
|
|
resources:
|
|
requests:
|
|
cpu: 250m
|
|
memory: 512Mi
|
|
limits:
|
|
cpu: "1"
|
|
memory: 1Gi
|
|
volumeMounts:
|
|
- name: mysql-data
|
|
mountPath: /var/lib/mysql
|
|
livenessProbe:
|
|
exec:
|
|
command:
|
|
- mysqladmin
|
|
- ping
|
|
- -h
|
|
- localhost
|
|
initialDelaySeconds: 120
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
failureThreshold: 10
|
|
readinessProbe:
|
|
exec:
|
|
command:
|
|
- mysqladmin
|
|
- ping
|
|
- -h
|
|
- localhost
|
|
initialDelaySeconds: 60
|
|
periodSeconds: 5
|
|
timeoutSeconds: 3
|
|
failureThreshold: 10
|
|
volumes:
|
|
- name: mysql-data
|
|
persistentVolumeClaim:
|
|
claimName: mysql-data
|