fix(mariadb): make cluster chart mode select replication/galera topology#3068
Draft
weicao wants to merge 1 commit into
Draft
fix(mariadb): make cluster chart mode select replication/galera topology#3068weicao wants to merge 1 commit into
weicao wants to merge 1 commit into
Conversation
The addons-cluster/mariadb chart used `componentDef: mariadb`, a name prefix
that matches all three CmpDs (mariadb-*, mariadb-replication-merged-*,
mariadb-galera-*), so it could not deterministically select replication or
galera. `mode` only drove the replica count. values.schema.json also locked
mode to ["standalone"] and replicas to maximum 1.
Switch to the KB-native selector: clusterDef: mariadb + topology: {{ .Values.mode }},
resolving the correct compDef from the mariadb ClusterDefinition's named
topologies. Expand the mode enum to standalone/replication/galera and raise the
replicas cap to 5 (standalone stays forced to 1 via the helper).
Fixes #3067
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3068 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 144 144
Lines 23013 23013
=====================================
Misses 23013 23013 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
addons-cluster/mariadbchart cannot select the replication or galera topology.modeonly changes the replica count; the Cluster always resolves an ambiguous componentDef.Root cause
templates/cluster.yamlused:componentDef: mariadbis a name prefix, and the addon ships three CmpDs:mariadb-<version>(standalone)mariadb-replication-merged-<version>(replication)mariadb-galera-<version>(galera)The prefix
mariadbmatches all three, so it cannot deterministically select replication or galera. Meanwhile the only topology lever ismode, whichtemplates/_helpers.tpluses solely to computereplicas(standalone → 1, else.Values.replicas). It never selects a component definition.values.schema.jsonfurther locked this down:modeenum was["standalone"]only, andreplicashadmaximum: 1. So even the schema forbade anything but a single standalone node.The addon already ships a
ClusterDefinitionnamedmariadbwith three named topologies (standalonedefault,replication,galera), each pinning the correctcompDefby full name — but the cluster chart did not use it.Fix
Use the KB-native topology selector (same idiom as clickhouse / apecloud-mysql cluster charts):
modemaps 1:1 to the ClusterDefinition topology names (standalone / replication / galera), sotopology: {{ .Values.mode }}resolves the correct compDef.values.schema.json:modeenum expanded to["standalone", "replication", "galera"];replicasmaximum raised from 1 to 5 (standalone is still forced to 1 by the helper).values.yaml: documented the mode options and replica guidance (replication ≥ 2, galera odd ≥ 3).Verification
helm templatefor all three modes rendersclusterDef: mariadb+ the correcttopology:, with no ambiguouscomponentDeffield; standalone forcesreplicas: 1, replication/galera honor the set value.