1
0
Fork 0

use statefulset for mariadb

This commit is contained in:
Massaki Archambault 2020-05-06 20:05:40 -04:00
parent e5458602e6
commit b454e5ec1f
2 changed files with 13 additions and 22 deletions

View File

@ -1,5 +1,5 @@
resources: resources:
- mariadb-deployment.yaml - mariadb-statefulset.yaml
secretGenerator: secretGenerator:
- name: mariadb-credentials-secret - name: mariadb-credentials-secret

View File

@ -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,23 +39,15 @@ spec:
volumeMounts: volumeMounts:
- name: mariadb-pvc - name: mariadb-pvc
mountPath: /var/lib/mysql mountPath: /var/lib/mysql
volumes: volumeClaimTemplates:
- name: mariadb-pvc - metadata:
persistentVolumeClaim: name: mariadb-pvc
claimName: mariadb-pvc spec:
--- accessModes:
apiVersion: v1 - ReadWriteOnce
kind: PersistentVolumeClaim resources:
metadata: requests:
name: mariadb-pvc storage: 20Gi
labels:
app: mariadb
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
--- ---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service