infra/old/cluster/wavelog/mariadb-deployment.yaml

67 lines
No EOL
1.3 KiB
YAML

---
apiVersion: v1
kind: Service
metadata:
name: mariadb
namespace: wavelog
spec:
selector:
app: mariadb
ports:
- port: 3306
targetPort: 3306
clusterIP: None
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mariadb
namespace: wavelog
spec:
serviceName: mariadb
replicas: 1
selector:
matchLabels:
app: mariadb
template:
metadata:
labels:
app: mariadb
spec:
containers:
- name: mariadb
image: mariadb:11
ports:
- containerPort: 3306
envFrom:
- secretRef:
name: mariadb-secret
volumeMounts:
- name: mariadb-storage
mountPath: /var/lib/mysql
livenessProbe:
tcpSocket:
port: 3306
initialDelaySeconds: 60
periodSeconds: 30
readinessProbe:
tcpSocket:
port: 3306
initialDelaySeconds: 30
periodSeconds: 10
resources:
requests:
memory: "512Mi"
cpu: "250m"
limits:
memory: "1Gi"
cpu: "500m"
volumeClaimTemplates:
- metadata:
name: mariadb-storage
spec:
accessModes: ["ReadWriteOnce"]
storageClassName: longhorn
resources:
requests:
storage: 10Gi