/
vttablet-pod-benchmarking-template.yaml
123 lines (115 loc) · 3.71 KB
/
vttablet-pod-benchmarking-template.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
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
114
115
116
117
118
119
120
121
122
kind: Pod
apiVersion: v1
metadata:
name: vttablet-{{uid}}
labels:
component: vttablet
keyspace: "{{keyspace}}"
shard: "{{shard_label}}"
tablet: "{{alias}}"
app: vitess
spec:
containers:
- name: vttablet
image: vitess/root
resources:
limits:
memory: "4Gi"
cpu: "2"
volumeMounts:
- name: syslog
mountPath: /dev/log
- name: vtdataroot
mountPath: /vt/vtdataroot
command:
- bash
- "-c"
- >-
set -e
mysql_socket="$VTDATAROOT/{{tablet_subdir}}/mysql.sock"
mkdir -p $VTDATAROOT/tmp
chown -R vitess /vt
while [ ! -e $mysql_socket ]; do
echo "[$(date)] waiting for $mysql_socket" ;
sleep 1 ;
done
su -p -s /bin/bash -c "mysql -u vt_dba -S $mysql_socket
-e 'CREATE DATABASE IF NOT EXISTS vt_{{keyspace}}'" vitess
su -p -s /bin/bash -c "/vt/bin/vttablet
-topo_implementation etcd
-etcd_global_addrs http://$ETCD_GLOBAL_SERVICE_HOST:$ETCD_GLOBAL_SERVICE_PORT
-log_dir $VTDATAROOT/tmp
-alsologtostderr
-port {{port}}
-grpc_port {{grpc_port}}
-service_map 'grpc-queryservice'
-tablet-path {{alias}}
-tablet_hostname $(hostname -i)
-init_keyspace {{keyspace}}
-init_shard {{shard}}
-target_tablet_type {{tablet_type}}
-mysqlctl_socket $VTDATAROOT/mysqlctl.sock
-db-config-app-uname vt_app
-db-config-app-dbname vt_{{keyspace}}
-db-config-app-charset utf8
-db-config-dba-uname vt_dba
-db-config-dba-dbname vt_{{keyspace}}
-db-config-dba-charset utf8
-db-config-repl-uname vt_repl
-db-config-repl-dbname vt_{{keyspace}}
-db-config-repl-charset utf8
-db-config-filtered-uname vt_filtered
-db-config-filtered-dbname vt_{{keyspace}}
-db-config-filtered-charset utf8
-queryserver-config-transaction-cap 300
-queryserver-config-schema-reload-time 1
-queryserver-config-pool-size 100
-enable-rowcache
-rowcache-bin /usr/bin/memcached
-rowcache-socket $VTDATAROOT/{{tablet_subdir}}/memcache.sock" vitess
env:
- name: GOMAXPROCS
value: "16"
- name: mysql
image: vitess/root
resources:
limits:
memory: "4Gi"
cpu: "2"
volumeMounts:
- name: syslog
mountPath: /dev/log
- name: vtdataroot
mountPath: /vt/vtdataroot
command:
- sh
- "-c"
- >-
mkdir -p $VTDATAROOT/tmp &&
chown -R vitess /vt
su -p -c "/vt/bin/mysqlctld
-log_dir $VTDATAROOT/tmp
-alsologtostderr
-tablet_uid {{uid}}
-socket_file $VTDATAROOT/mysqlctl.sock
-db-config-app-uname vt_app
-db-config-app-dbname vt_{{keyspace}}
-db-config-app-charset utf8
-db-config-dba-uname vt_dba
-db-config-dba-dbname vt_{{keyspace}}
-db-config-dba-charset utf8
-db-config-repl-uname vt_repl
-db-config-repl-dbname vt_{{keyspace}}
-db-config-repl-charset utf8
-db-config-filtered-uname vt_filtered
-db-config-filtered-dbname vt_{{keyspace}}
-db-config-filtered-charset utf8
-bootstrap_archive mysql-db-dir_10.0.13-MariaDB.tbz" vitess
env:
- name: EXTRA_MY_CNF
value: /vt/config/mycnf/benchmark.cnf:/vt/config/mycnf/master_mariadb.cnf
volumes:
- name: syslog
hostPath: {path: /dev/log}
- name: vtdataroot
{{vtdataroot_volume}}