Changed MySQL server to a statfulset
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: mysql-pvc
|
||||
namespace: app-notifications
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
|
||||
@@ -10,4 +10,4 @@ spec:
|
||||
- protocol: TCP
|
||||
port: 3306
|
||||
targetPort: 3306
|
||||
type: ClusterIP
|
||||
clusterIP: None
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: mysql
|
||||
namespace: app-notifications
|
||||
spec:
|
||||
serviceName: mysql
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
@@ -13,10 +14,6 @@ spec:
|
||||
labels:
|
||||
app: mysql
|
||||
spec:
|
||||
volumes:
|
||||
- name: mysql-data
|
||||
persistentVolumeClaim:
|
||||
claimName: mysql-pvc
|
||||
containers:
|
||||
- name: mysql
|
||||
image: mysql:8.0.4
|
||||
@@ -31,3 +28,12 @@ spec:
|
||||
volumeMounts:
|
||||
- name: mysql-data
|
||||
mountPath: /var/lib/mysql
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: mysql-data
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
Reference in New Issue
Block a user