forked from mariadb-operator/mariadb-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mariadb_full.yaml
111 lines (94 loc) · 2.13 KB
/
mariadb_full.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
apiVersion: k8s.mariadb.com/v1alpha1
kind: MariaDB
metadata:
name: mariadb
spec:
rootPasswordSecretKeyRef:
name: mariadb
key: root-password
username: mariadb
passwordSecretKeyRef:
name: mariadb
key: password
database: mariadb
image: docker-registry1.mariadb.com/library/mariadb:10.11.8
imagePullPolicy: IfNotPresent
imagePullSecrets:
- name: registry # run 'make registry-secret' to generate a secret from ~/.docker/config.json
port: 3306
storage:
size: 1Gi
storageClassName: standard
resizeInUseVolumes: true
waitForVolumeResize: true
volumes:
- name: mariabackup
persistentVolumeClaim:
claimName: mariabackup
volumeMounts:
- name: mariabackup
mountPath: /var/mariadb/backup/
connection:
secretName: connection-mariadb
secretTemplate:
key: dsn
healthCheck:
interval: 10s
retryInterval: 3s
params:
parseTime: "true"
myCnf: |
[mariadb]
bind-address=*
default_storage_engine=InnoDB
binlog_format=row
innodb_autoinc_lock_mode=2
innodb_buffer_pool_size=1024M
max_allowed_packet=256M
myCnfConfigMapKeyRef:
name: mariadb
key: my.cnf
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
memory: 1Gi
env:
- name: TZ
value: SYSTEM
podSecurityContext:
runAsUser: 0
securityContext:
allowPrivilegeEscalation: false
livenessProbe:
exec:
command:
- bash
- -c
- mariadb -u root -p"${MARIADB_ROOT_PASSWORD}" -e "SELECT 1;"
initialDelaySeconds: 20
periodSeconds: 5
timeoutSeconds: 5
readinessProbe:
exec:
command:
- bash
- -c
- mariadb -u root -p"${MARIADB_ROOT_PASSWORD}" -e "SELECT 1;"
initialDelaySeconds: 20
periodSeconds: 5
timeoutSeconds: 5
podDisruptionBudget:
maxUnavailable: 50%
updateStrategy:
type: ReplicasFirstPrimaryLast
service:
type: LoadBalancer
metadata:
annotations:
metallb.universe.tf/loadBalancerIPs: 172.18.0.20
externalTrafficPolicy: Cluster
sessionAffinity: None
metrics:
enabled: true