From c07870d068e2272cf54ce4cd686e1264b0fa469d Mon Sep 17 00:00:00 2001 From: Viktor Barzin Date: Sun, 1 Mar 2026 12:16:28 +0000 Subject: [PATCH] [ci skip] fix MySQL service: point at mysqld pods, pin to healthy primary The InnoDB Cluster Router (mysqlrouter) doesn't deploy when the cluster lacks quorum. Changed service selector from mysqlrouter to mysqld with publishNotReadyAddresses=true to bypass the operator's readiness gate. Pinned to mysql-cluster-1 (healthy primary) until full cluster recovers. --- stacks/platform/modules/dbaas/main.tf | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/stacks/platform/modules/dbaas/main.tf b/stacks/platform/modules/dbaas/main.tf index e80ecfcc..126a935d 100644 --- a/stacks/platform/modules/dbaas/main.tf +++ b/stacks/platform/modules/dbaas/main.tf @@ -121,21 +121,24 @@ resource "helm_release" "mysql_cluster" { depends_on = [helm_release.mysql_operator] } -# Compatibility service: mysql.dbaas points at InnoDB Cluster Router -# Router handles automatic failover — clients connect here transparently +# Compatibility service: mysql.dbaas points at InnoDB Cluster mysqld pods +# When router is available it handles failover, but we fall back to direct +# mysqld access to avoid total outage during partial cluster failures resource "kubernetes_service" "mysql" { metadata { name = var.cluster_master_service namespace = kubernetes_namespace.dbaas.metadata[0].name } spec { + publish_not_ready_addresses = true # bypass InnoDB Cluster readiness gate during partial failures selector = { - "component" = "mysqlrouter" - "mysql.oracle.com/cluster" = "mysql-cluster" + "component" = "mysqld" + "mysql.oracle.com/cluster" = "mysql-cluster" + "statefulset.kubernetes.io/pod-name" = "mysql-cluster-1" # pin to healthy primary until cluster recovers } port { port = 3306 - target_port = 6446 + target_port = 3306 } }