-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathmysql-dp.yml
54 lines (54 loc) · 1.38 KB
/
mysql-dp.yml
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
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: portal-mysql
labels:
app: portal-mysql
spec:
strategy:
type: Recreate
template:
metadata:
labels:
app: portal-mysql
# annotations:
# pod.alpha.kubernetes.io/init-containers: '[
# {
# "name": "mysql-init",
# "image": "busybox",
# "imagePullPolicy": "IfNotPresent",
# "command": ["sh", "-c", "chown -R 999:999 /var/lib/mysql"],
# "volumeMounts": [
# {
# "name": "mysql-pv",
# "mountPath": "/var/lib/mysql"
# }
# ]
# }
# ]'
spec:
# securityContext:
# fsGroup: 999
containers:
- name: portal-mysql
image: mysql:5.6
env:
- name: MYSQL_DATABASE
value: ceph
# $ echo -n "1f2d1e2e67df" > ./password.txt
# $ kubectl create secret generic mysql-pass --from-file=password.txt
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-pass
key: password.txt
ports:
- containerPort: 3306
# volumeMounts:
# - name: mysql-pv
# mountPath: /var/lib/mysql
# volumes:
# - name: mysql-pv
# persistentVolumeClaim:
# claimName: portal-mysql-pvc