mariadb-server.yaml
3.11 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
---
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: {}
- name: etc
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
- name: init-mariadb
image: mariadb
command: ["/var/scripts/bitnami-mariadb-entrypoint-initContainer.sh"]
volumeMounts:
- name: mariadb-scripts
mountPath: /var/scripts
- name: mariadb-data
mountPath: /bitnami/mariadb
- name: mariadb-config
mountPath: /var/mariadb-config
- name: mariadb-secret
mountPath: /var/mariadb-secret
- name: mariadb-entrypoint-initdb
mountPath: /docker-entrypoint-initdb.d
- name: etc
mountPath: /runtime-etc
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
containers:
- name: mariadb
image: mariadb
#securityContext:
# runAsUser: 1001
# runAsGroup: 1001
command: ["/var/scripts/bitnami-mariadb-entrypoint-container.sh"]
args: ["/opt/bitnami/scripts/mariadb/run.sh"]
volumeMounts:
- name: mariadb-scripts
mountPath: /var/scripts
- name: mariadb-data
mountPath: /bitnami/mariadb
- name: etc
mountPath: /etc