-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathstatefulset-mariadb.yaml
More file actions
88 lines (88 loc) · 2.25 KB
/
Copy pathstatefulset-mariadb.yaml
File metadata and controls
88 lines (88 loc) · 2.25 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
# Source: ghost/charts/mariadb/templates/primary/statefulset.yaml
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mariadb
namespace: example
labels:
app.kubernetes.io/name: mariadb
spec:
replicas: 1
revisionHistoryLimit: 10
serviceName: mariadb
updateStrategy:
type: RollingUpdate
template:
spec:
securityContext:
fsGroup: 1001
initContainers:
- name: configmap-map-to-file
image: gcr.io/kpt-fn-demo/yuwenma-cm-env-to-ini:v0.12
env:
- name: CM_INI_FILE_NAME
value: my.cnf
envFrom:
- configMapRef:
name: mariadb
volumeMounts:
- name: ini-config
# the env-to-ini.py cannot be placed in the same mount dir.
# Because it will be overridden.
mountPath: /app
- name: verify
image: ubuntu
command: ["/bin/sh","-c"]
args: ["ls /tmp; cat /tmp/my.cnf"]
volumeMounts:
- name: ini-config
mountPath: /tmp/my.cnf
subPath: my.cnf
containers:
- name: mariadb
image: docker.io/bitnami/mariadb:10.6.7-debian-10-r62
imagePullPolicy: IfNotPresent
securityContext:
runAsNonRoot: true
runAsUser: 1001
env:
- name: BITNAMI_DEBUG
value: "true"
- name: MARIADB_USER
value: bn_ghost
- name: MARIADB_DATABASE
value: bitnami_ghost
- name: ALLOW_EMPTY_PASSWORD
value: "true"
ports:
- name: mysql
containerPort: 3307
resources:
limits: {}
requests: {}
volumeMounts:
- name: data
mountPath: /bitnami/mariadb
- name: ini-config
mountPath: /opt/bitnami/mariadb/conf/my.cnf
subPath: my.cnf
volumes:
- name: ini-config
emptyDir: {}
metadata:
labels:
app.kubernetes.io/name: mariadb
volumeClaimTemplates:
- metadata:
name: data
labels:
app.kubernetes.io/name: mariadb
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 8Gi
selector:
matchLabels:
app.kubernetes.io/name: mariadb