infra/k8s/monica/mysql.yaml
Finn 5bf9d9bffc
Some checks failed
/ diff-and-deploy (push) Failing after 52s
downgrade mysql for monica
2024-10-29 23:54:32 -07:00

57 lines
1.1 KiB
YAML

apiVersion: v1
kind: Service
metadata:
name: mysql
namespace: monica
spec:
ports:
- name: mysql
port: 3306
selector:
app: mysql
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mysql
namespace: monica
spec:
selector:
matchLabels:
app: mysql
serviceName: mysql
replicas: 1
template:
metadata:
labels:
app: mysql
spec:
containers:
- image: docker.io/library/mysql:5.7
name: mysql
resources: {}
ports:
- name: mysql
containerPort: 3306
volumeMounts:
- name: storage
mountPath: /var/lib/mysql
env:
- name: MYSQL_DATABASE
value: monica
- name: MYSQL_USER
value: monica
- name: MYSQL_ROOT_PASSWORD
value: "true"
envFrom:
- secretRef:
name: mysql
volumeClaimTemplates:
- metadata:
name: storage
spec:
# storageClassName: longhorn
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 1Gi