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