File tree Expand file tree Collapse file tree 3 files changed +7
-0
lines changed
Expand file tree Collapse file tree 3 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ const (
3232
3333 mysqldExporterContainerName = "mysqld-exporter"
3434 mysqldExporterCommand = "/bin/mysqld_exporter"
35+ mysqldExporterMySQLCnf = "client.cnf"
3536 mysqldExporterUser = "vt_dba"
3637 mysqldExporterPort = 9104
3738 mysqldExporterPortName = "metrics"
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ ln -sf /dev/stderr /mnt/vt/config/stderr.symlink
4040echo "log-error = /vt/config/stderr.symlink" > /mnt/vt/config/mycnf/log-error.cnf
4141echo "binlog_format=row" > /mnt/vt/config/mycnf/rbr.cnf
4242echo "socket = ` + mysqlSocketPath + `" > /mnt/vt/config/mycnf/socket.cnf
43+ echo -n "[client]\nuser=vt_dba\nsocket=` + mysqlSocketPath + `\n" > /mnt/vt/config/mycnf/client.cnf
4344`
4445
4546 mysqlSocketInitScript = `set -ex
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ limitations under the License.
1717package vttablet
1818
1919import (
20+ "path/filepath"
2021 "strconv"
2122 "strings"
2223
@@ -256,6 +257,10 @@ func UpdatePod(obj *corev1.Pod, spec *Spec) {
256257 if spec .MysqldExporter != nil && (len (spec .MysqldExporter .Resources .Limits ) > 0 || len (spec .MysqldExporter .Resources .Requests ) > 0 ) {
257258 update .ResourceRequirements (& mysqldExporterContainer .Resources , & spec .MysqldExporter .Resources )
258259 }
260+
261+ if _ , ok := spec .MysqldExporter .ExtraFlags ["config.my-cnf" ]; ! ok {
262+ spec .MysqldExporter .ExtraFlags ["config.my-cnf" ] = filepath .Join (vtMycnfPath , mysqldExporterMySQLCnf )
263+ }
259264 }
260265
261266 // Set the resource requirements on each of the default vttablet init
You can’t perform that action at this time.
0 commit comments