use statefulset for mariadb
This commit is contained in:
parent
e5458602e6
commit
b454e5ec1f
|
@ -1,5 +1,5 @@
|
|||
resources:
|
||||
- mariadb-deployment.yaml
|
||||
- mariadb-statefulset.yaml
|
||||
|
||||
secretGenerator:
|
||||
- name: mariadb-credentials-secret
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: mariadb-deployment
|
||||
name: mariadb-statefulset
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mariadb
|
||||
strategy:
|
||||
type: Recreate
|
||||
serviceName: mariadb
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
|
@ -40,23 +39,15 @@ spec:
|
|||
volumeMounts:
|
||||
- name: mariadb-pvc
|
||||
mountPath: /var/lib/mysql
|
||||
volumes:
|
||||
- name: mariadb-pvc
|
||||
persistentVolumeClaim:
|
||||
claimName: mariadb-pvc
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: mariadb-pvc
|
||||
labels:
|
||||
app: mariadb
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 20Gi
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: mariadb-pvc
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 20Gi
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
Loading…
Reference in New Issue