apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mysql-ss
spec:
selector:
matchLabels:
app: my-php-app
serviceName: mysql-service
replicas: 1
template:
metadata:
labels:
app: my-php-app
spec:
containers:
- name: mysql
image: mariadb
ports:
- containerPort: 3306
name: mysql
volumeMounts:
- name: mysql-vm
mountPath: /var/lib/mysql
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-pass
key: password
volumes:
- name: mysql-vm
persistentVolumeClaim:
claimName: mysql-pvc
- name: config-volume
configMap:
name: mysql-conf
apiVersion: v1
kind: Secret
metadata:
creationTimestamp: null
name: mysql-pass
type: Opaque
data:
password: YWRtaW4=
37.140.199.175:8000