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-11-20 18:01:55 +00:00
|
|
|
- image: docker.io/library/mysql:9.1
|
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
|