Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
Merge pull request #38 from tmirks/fix-sts-scale-down
Browse files Browse the repository at this point in the history
Fix StatefulSet scale down
  • Loading branch information
Jasper de Jager authored Apr 12, 2019
2 parents 7ece10c + 064b1d2 commit 2001e4a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
7 changes: 7 additions & 0 deletions deploy/charts/proxysql-cluster/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ spec:
- mountPath: /etc/proxysql.cnf
name: proxysql
subPath: proxysql.cnf
lifecycle:
preStop:
exec:
command:
- /bin/bash
- -c
- "/usr/bin/proxysql-cli remove"
{{ if .Values.resources }}
resources:
{{ .Values.resources | indent 12 }}
Expand Down
11 changes: 10 additions & 1 deletion docker/files/cli/commands/cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,20 @@ command_query:rules() {
proxysql_execute_query_hr "SELECT * FROM mysql_query_rules"
}

commands_add "query:nodes" "Show al the nodes of the cluster"
commands_add "query:nodes" "Show all the nodes of the cluster"
command_query:nodes() {
proxysql_execute_query_hr "SELECT * FROM proxysql_servers;"
}

commands_add "remove" "Remove this node from the cluster"
command_remove() {
proxysql_execute_query_hr "
DELETE FROM proxysql_servers
WHERE hostname = '${IP}';
LOAD PROXYSQL SERVERS TO RUN;
" ${PROXYSQL_SERVICE}
}

commands_add "sync" "Synchronize from backends"
command_sync() {
local joinExistingCluster=${1};
Expand Down

0 comments on commit 2001e4a

Please sign in to comment.