68 lines
1.3 KiB
YAML
68 lines
1.3 KiB
YAML
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: mariadb-data
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
storageClassName: nfs-client
|
|
resources:
|
|
requests:
|
|
storage: 500Mi
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: mariadb
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: mariadb
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: mariadb
|
|
spec:
|
|
containers:
|
|
- name: mariadb
|
|
image: mariadb:10.2
|
|
ports:
|
|
- name: mariadb
|
|
containerPort: 3306
|
|
protocol: TCP
|
|
readinessProbe:
|
|
tcpSocket:
|
|
port: 3306
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
successThreshold: 1
|
|
failureThreshold: 3
|
|
volumeMounts:
|
|
- name: mariadb-data
|
|
mountPath: /var/lib/mysql
|
|
readOnly: true
|
|
envFrom:
|
|
- secretRef:
|
|
name: mariadb-secrets
|
|
volumes:
|
|
- name: mariadb-data
|
|
persistentVolumeClaim:
|
|
claimName: mariadb-data
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: mariadb
|
|
spec:
|
|
type: ClusterIP
|
|
selector:
|
|
app: mariadb
|
|
ports:
|
|
- name: mariadb
|
|
port: 3306
|
|
targetPort: 3306
|
|
protocol: TCP
|
|
|