added db to symfony
This commit is contained in:
@@ -0,0 +1,105 @@
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: mariadb
|
||||
namespace: symfony
|
||||
|
||||
spec:
|
||||
serviceName: mariadb
|
||||
replicas: 1
|
||||
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mariadb
|
||||
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: mariadb
|
||||
|
||||
spec:
|
||||
nodeSelector:
|
||||
kubernetes.io/hostname: cluster-01
|
||||
|
||||
containers:
|
||||
- name: mariadb
|
||||
image: mariadb:11.8
|
||||
imagePullPolicy: IfNotPresent
|
||||
|
||||
ports:
|
||||
- name: mysql
|
||||
containerPort: 3306
|
||||
|
||||
env:
|
||||
- name: MARIADB_ROOT_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: mariadb-credentials
|
||||
key: root-password
|
||||
|
||||
- name: MARIADB_DATABASE
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: mariadb-credentials
|
||||
key: database
|
||||
|
||||
- name: MARIADB_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: mariadb-credentials
|
||||
key: username
|
||||
|
||||
- name: MARIADB_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: mariadb-credentials
|
||||
key: password
|
||||
|
||||
volumeMounts:
|
||||
- name: database
|
||||
mountPath: /var/lib/mysql
|
||||
|
||||
readinessProbe:
|
||||
exec:
|
||||
command:
|
||||
- healthcheck.sh
|
||||
- --connect
|
||||
- --innodb_initialized
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 5
|
||||
timeoutSeconds: 3
|
||||
failureThreshold: 12
|
||||
|
||||
livenessProbe:
|
||||
exec:
|
||||
command:
|
||||
- healthcheck.sh
|
||||
- --connect
|
||||
- --innodb_initialized
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 6
|
||||
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 256Mi
|
||||
|
||||
limits:
|
||||
cpu: "1"
|
||||
memory: 1Gi
|
||||
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: database
|
||||
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
|
||||
storageClassName: local-path
|
||||
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
Reference in New Issue
Block a user