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
|
- protocol: TCP
|
||||||
port: 3306
|
port: 3306
|
||||||
targetPort: 3306
|
targetPort: 3306
|
||||||
type: ClusterIP
|
clusterIP: None
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: StatefulSet
|
||||||
metadata:
|
metadata:
|
||||||
name: mysql
|
name: mysql
|
||||||
namespace: app-notifications
|
namespace: app-notifications
|
||||||
spec:
|
spec:
|
||||||
|
serviceName: mysql
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
@@ -13,10 +14,6 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
app: mysql
|
app: mysql
|
||||||
spec:
|
spec:
|
||||||
volumes:
|
|
||||||
- name: mysql-data
|
|
||||||
persistentVolumeClaim:
|
|
||||||
claimName: mysql-pvc
|
|
||||||
containers:
|
containers:
|
||||||
- name: mysql
|
- name: mysql
|
||||||
image: mysql:8.0.4
|
image: mysql:8.0.4
|
||||||
@@ -31,3 +28,12 @@ spec:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: mysql-data
|
- name: mysql-data
|
||||||
mountPath: /var/lib/mysql
|
mountPath: /var/lib/mysql
|
||||||
|
volumeClaimTemplates:
|
||||||
|
- metadata:
|
||||||
|
name: mysql-data
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 10Gi
|
||||||
Reference in New Issue
Block a user