diff --git a/k8s/anvil/configmap-proxysql.yaml b/k8s/anvil/configmap-proxysql.yaml new file mode 100644 index 0000000..5de3425 --- /dev/null +++ b/k8s/anvil/configmap-proxysql.yaml @@ -0,0 +1,82 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: proxysql-config +data: + proxysql.cnf: | + datadir="/var/lib/proxysql" + + admin_variables= + { + admin_credentials="admin:admin;radmin:radmin" + mysql_ifaces="0.0.0.0:6032" + } + + mysql_variables= + { + threads=4 + max_connections=2048 + default_query_delay=0 + default_query_timeout=36000000 + have_compress=true + poll_timeout=2000 + interfaces="0.0.0.0:6033" + default_schema="information_schema" + stacksize=1048576 + server_version="8.0.32" + connect_timeout_server=3000 + monitor_username="app" + monitor_password="app-pass" + monitor_history=600000 + monitor_connect_interval=60000 + monitor_ping_interval=10000 + monitor_read_only_interval=1500 + monitor_read_only_timeout=500 + ping_interval_server_msec=120000 + ping_timeout_server=500 + commands_stats=true + sessions_sort=true + connect_retries_on_failure=10 + connection_max_age_ms=0 + free_connections_pct=10 + } + + mysql_servers = + ( + { + address = "mariadb" + port = 3306 + hostgroup = 0 + max_connections = 100 + weight = 1 + } + ) + + mysql_users = + ( + { + username = "app" + password = "app-pass" + default_hostgroup = 0 + max_connections = 200 + transaction_persistent = 1 + } + ) + + mysql_query_rules = + ( + { + rule_id = 1 + active = 1 + match_pattern = "^SELECT .* FOR UPDATE$" + destination_hostgroup = 0 + apply = 1 + }, + { + rule_id = 2 + active = 1 + match_pattern = "^SELECT" + destination_hostgroup = 0 + apply = 1 + } + )