-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjumpserver-mysql.yml
101 lines (96 loc) · 2.14 KB
/
jumpserver-mysql.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
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
---
# Configmap
apiVersion: v1
kind: ConfigMap
metadata:
name: jumpserver-mysql
namespace: ops
data:
mysqld.cnf: |
[mysqld]
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
datadir = /var/lib/mysql
# log-error = /var/log/mysql/error.log
bind-address = 0.0.0.0
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
max_connections=1000
default_storage_engine=innodb
skip_external_locking
lower_case_table_names=1
skip_host_cache
skip_name_resolve
character_set_server=utf8
sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'
---
# PVC
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: jumpserver-mysql
namespace: ops
spec:
storageClassName: managed-nfs-storage
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10G
---
# Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: jumpserver-mysql
namespace: ops
spec:
replicas: 1
selector:
matchLabels:
app: jumpserver-mysql
template:
metadata:
labels:
app: jumpserver-mysql
spec:
containers:
- env:
- name: MYSQL_ROOT_PASSWORD
value: t2dpFnyY9g3rurge9tn1
image: mysql:5.7
name: jumpserver-mysql
ports:
- containerPort: 3306
protocol: TCP
name: http
volumeMounts:
- name: data
mountPath: /var/lib/mysql
readOnly: false
subPath: mysql5
- name: config
mountPath: /etc/mysql/mysql.conf.d
volumes:
- name: data
persistentVolumeClaim:
claimName: jumpserver-mysql
- name: config
configMap:
name: jumpserver-mysql
---
# Service
apiVersion: v1
kind: Service
metadata:
name: jumpserver-mysql
namespace: ops
spec:
type: ClusterIP
ports:
- name: jumpserver-mysql
port: 3306
protocol: TCP
targetPort: http
selector:
app: jumpserver-mysql