-
Notifications
You must be signed in to change notification settings - Fork 881
/
mysql-deployment.yaml
66 lines (66 loc) · 2.7 KB
/
mysql-deployment.yaml
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
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql
labels:
app: mysql
spec:
selector:
matchLabels:
app: mysql
strategy:
type: Recreate
template:
metadata:
labels:
app: mysql
spec:
serviceAccountName: mysql
containers:
- args:
# https://dev.mysql.com/doc/refman/5.7/en/server-options.html#option_mysqld_ignore-db-dir
# Ext4, Btrfs etc. volumes root directories have a lost+found directory that should not be treated as a database.
# ignore-db-dir option has been deprecated in mysql v5.7.16.
#
# If upgrading MySQL to v8.0 fails, try removing /var/lib/mysql/lost+found folder in
# mysql-pv-claim (mysql-persistent-storage):
#
# kubectl exec -it <mysql-pod-name> -n kubeflow -- bash
# rm -rf /var/lib/mysql/lost+found
#
# More details on upgrading MySQL can be found here:
# https://dev.mysql.com/doc/refman/8.0/en/upgrade-prerequisites.html
# https://dev.mysql.com/doc/refman/8.0/en/upgrade-docker-mysql.html
- --datadir
- /var/lib/mysql
# MLMD workloads (metadata-grpc-deployment and metadata-writer) depend on mysql_native_password authentication plugin.
# mysql_native_password plugin implements native authentication; that is, authentication based on the password
# hashing method in use from before the introduction of pluggable authentication in MySQL 8.0.
#
# As default_authentication_plugin option is deprecated in MySQL 8.0.27 this needs to be replaced with
# appropriate authentication_policy in the next upgrade. See more details:
# https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_default_authentication_plugin
# https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_authentication_policy
- --default-authentication-plugin=mysql_native_password
# Disable binlog as the logs grow fast and eat up all disk spaces eventually. And KFP doesn't currently utilize binlog.
# https://dev.mysql.com/doc/refman/8.0/en/replication-options-binary-log.html#option_mysqld_log-bin
- --disable-log-bin
env:
- name: MYSQL_ALLOW_EMPTY_PASSWORD
value: "true"
image: gcr.io/ml-pipeline/mysql:8.0.26
name: mysql
ports:
- containerPort: 3306
name: mysql
volumeMounts:
- mountPath: /var/lib/mysql
name: mysql-persistent-storage
resources:
requests:
cpu: 100m
memory: 800Mi
volumes:
- name: mysql-persistent-storage
persistentVolumeClaim:
claimName: mysql-pv-claim