mariadb-server.yaml
2.37 KB
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
---
apiVersion: v1
kind: Service
metadata:
name: mariadb
spec:
selector:
app: mariadb-server
ports:
- name: mysql
protocol: TCP
port: 3306
targetPort: 3306
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mariadb-server
labels:
app: mariadb-server
spec:
replicas: 1
progressDeadlineSeconds: 600
selector:
matchLabels:
app: mariadb-server
template:
metadata:
labels:
app: mariadb-server
spec:
restartPolicy: Always
securityContext:
runAsUser: 0
runAsGroup: 0
volumes:
- name: mariadb-data
persistentVolumeClaim:
claimName: mariadb-data
- name: mariadb-entrypoint-initdb
persistentVolumeClaim:
claimName: mariadb-entrypoint-initdb
- name: mariadb-scripts
configMap:
name: mariadb-scripts
defaultMode: 0755
- name: mariadb-config
configMap:
name: mariadb-config
- name: mariadb-secret
secret:
secretName: mariadb-secret
- name: database-restore
emptyDir: {}
initContainers:
- name: wait-for-file
image: debian
command: ["/scripts/wait-for-file"]
volumeMounts:
- name: mariadb-entrypoint-initdb
mountPath: /docker-entrypoint-initdb.d
- name: mariadb-scripts
mountPath: /scripts
env:
- name: WAIT_FOR_FILE
value: /docker-entrypoint-initdb.d/.restored
containers:
- name: mariadb
image: mariadb
volumeMounts:
- name: mariadb-data
mountPath: /var/lib/mysql
- name: mariadb-config
mountPath: /var/mariadb-config
- name: mariadb-secret
mountPath: /var/mariadb-secret
- name: mariadb-entrypoint-initdb
mountPath: /docker-entrypoint-initdb.d
env:
- name: MARIADB_DATABASE_FILE
value: /var/mariadb-config/MARIADB_DATABASE
- name: MARIADB_USER_FILE
value: /var/mariadb-config/MARIADB_USER
- name: MARIADB_PASSWORD_FILE
value: /var/mariadb-secret/MARIADB_PASSWORD
- name: MARIADB_ROOT_PASSWORD_FILE
value: /var/mariadb-secret/MARIADB_ROOT_PASSWORD