infra/k8s/monica/mysql.yaml

58 lines
1.1 KiB
YAML
Raw Permalink Normal View History

2024-04-21 05:52:32 +00:00
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:
2024-10-30 06:54:32 +00:00
- image: docker.io/library/mysql:5.7
2024-04-21 05:52:32 +00:00
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:
2024-10-30 06:52:52 +00:00
# storageClassName: longhorn
2024-04-21 05:52:32 +00:00
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 1Gi