|
| 1 | +# ClusterSet Resource options |
| 2 | + |
| 3 | +The `PerconaServerMySQLClusterSet` Custom Resource defines cross-site replication between Group Replication clusters as a MySQL InnoDB ClusterSet. Use the short name `ps-clusterset`. |
| 4 | + |
| 5 | +This document describes all available options. For status fields and conditions, see [Custom resource statuses](cr-statuses.md). |
| 6 | + |
| 7 | +## `apiVersion` |
| 8 | + |
| 9 | +Specifies the API version of the Custom Resource. |
| 10 | + |
| 11 | +| Value type | Example | |
| 12 | +| ---------- | ------- | |
| 13 | +| :material-code-string: string | `ps.percona.com/v1` | |
| 14 | + |
| 15 | +## `kind` |
| 16 | + |
| 17 | +Defines the type of resource: `PerconaServerMySQLClusterSet`. |
| 18 | + |
| 19 | +## `metadata` |
| 20 | + |
| 21 | +The metadata section identifies the ClusterSet object. It includes the following keys: |
| 22 | + |
| 23 | +* `name` — Name of the ClusterSet resource. |
| 24 | +* `namespace` — Namespace where the ClusterSet Custom Resource and the `mysqlshell-runner` Pod run. |
| 25 | +* `finalizers` — ensure safe deletion of resources in Kubernetes under certain conditions. This subsection includes the following finalizers: |
| 26 | + |
| 27 | + * `percona.com/clusterset-dissolve` — Runs `.dissolve()` on the InnoDB ClusterSet before the Custom Resource is deleted. Underlying clusters continue as standalone InnoDB Clusters. |
| 28 | + |
| 29 | +## `spec` |
| 30 | + |
| 31 | +This section contains the ClusterSet configuration. |
| 32 | + |
| 33 | +### `spec.primaryCluster` |
| 34 | + |
| 35 | +Name of the InnoDB cluster that should serve writes. Must match exactly one `spec.clusters[].innodbClusterName`. Must contain only alphanumeric characters (max 63). |
| 36 | + |
| 37 | +Editing this field triggers a **planned switchover** when the current primary is reachable. For a **forced failover** when the current primary is unreachable, you must also set the [`spec.unsafeFlags.forcedFailover`](#specunsafeflagsforcedfailover) to `true`. |
| 38 | + |
| 39 | +| Value type | Example | |
| 40 | +| ---------- | ------- | |
| 41 | +| :material-code-string: string | `pscluster1` | |
| 42 | + |
| 43 | +### The `spec.unsafeFlags` subsection |
| 44 | + |
| 45 | +Groups opt-in flags for destructive ClusterSet operations. Both default to `false`. |
| 46 | + |
| 47 | +#### `spec.unsafeFlags.forcedFailover` |
| 48 | + |
| 49 | +When `true`, permits `forcePrimaryCluster()` if you change `spec.primaryCluster` while the current primary is unreachable. |
| 50 | + |
| 51 | +| Value type | Example | |
| 52 | +| ---------- | ------- | |
| 53 | +| :material-toggle-switch-outline: boolean | `false` | |
| 54 | + |
| 55 | +!!! warning |
| 56 | + |
| 57 | + Forced failover can promote a replica while the old primary may still accept writes, causing split-brain and lost transactions. Set this only when you are certain the old primary cannot recover. |
| 58 | + |
| 59 | +#### `spec.unsafeFlags.forcedClusterRemoval` |
| 60 | + |
| 61 | +When `true`, permits `removeCluster(..., {force: true})` for an unreachable replica removed from `spec.clusters[]`. |
| 62 | + |
| 63 | +| Value type | Example | |
| 64 | +| ---------- | ------- | |
| 65 | +| :material-toggle-switch-outline: boolean | `false` | |
| 66 | + |
| 67 | +!!! warning |
| 68 | + |
| 69 | + Forced removal abandons unreplicated transactions on the removed cluster. The cluster may require manual cleanup or a full rebuild. |
| 70 | + |
| 71 | +### `spec.sslMode` |
| 72 | + |
| 73 | +SSL mode for ClusterSet async replication channels between primary and replica clusters. |
| 74 | + |
| 75 | +| Value | Meaning | |
| 76 | +| ----- | ------- | |
| 77 | +| `AUTO` | TLS is enabled if the instance supports it; otherwise disabled. **Default.** | |
| 78 | +| `DISABLED` | TLS is disabled for replication channels. | |
| 79 | +| `REQUIRED` | TLS is required for replication channels. | |
| 80 | +| `VERIFY_CA` | Like `REQUIRED`, plus verify the peer certificate against configured CA certificates. Primary and replica certificates must be signed by the same CA. | |
| 81 | +| `VERIFY_IDENTITY` | Like `VERIFY_CA`, plus verify the peer certificate matches the connection host (SAN must match `spec.clusters[].endpoints[].host`). | |
| 82 | + |
| 83 | +| Value type | Example | |
| 84 | +| ---------- | ------- | |
| 85 | +| :material-code-string: string | `AUTO` | |
| 86 | + |
| 87 | +### `spec.credentialsSecret.name` |
| 88 | + |
| 89 | +The name of a Secret in the same namespace that holds the `clusterset` user password. |
| 90 | + |
| 91 | +| Value type | Example | |
| 92 | +| ---------- | ------- | |
| 93 | +| :material-code-string: string | `ps-cluster1-secrets` | |
| 94 | + |
| 95 | +### `spec.credentialsSecret.key` |
| 96 | + |
| 97 | +The field in the Secret that holds the `clusterset` user password value. This password must match on every participating cluster. Defaults to `clusterset`. |
| 98 | + |
| 99 | +| Value type | Example | |
| 100 | +| ---------- | ------- | |
| 101 | +| :material-code-string: string | `clusterset` | |
| 102 | + |
| 103 | +### The `spec.clusters` subsection |
| 104 | + |
| 105 | +List of InnoDB clusters that participate in the ClusterSet. Minimum 1 entry (primary only at bootstrap); maximum 10. Each cluster name must be unique. |
| 106 | + |
| 107 | +#### `spec.clusters[].innodbClusterName` |
| 108 | + |
| 109 | +Logical name of the InnoDB cluster within the ClusterSet. Used in `spec.primaryCluster`, status, and MySQL Shell AdminAPI calls. The name must match the value from `status.innodbClusterName` of a corresponding `PerconaServerMySQL` Custom Resource. |
| 110 | + |
| 111 | +Alphanumeric only, max 63 characters. Immutable in practice — rename by remove and re-add. |
| 112 | + |
| 113 | +| Value type | Example | |
| 114 | +| ---------- | ------- | |
| 115 | +| :material-code-string: string | `pscluster1` | |
| 116 | + |
| 117 | +#### `spec.clusters[].endpoints` |
| 118 | + |
| 119 | +List of `host:port` pairs the controller uses to reach MySQL members of this cluster. Minimum 1, maximum 9 per cluster. The controller uses the first reachable endpoint. Multiple entries improve resilience to single-member failures. |
| 120 | + |
| 121 | +Each `host` must be unique across **all** clusters in the ClusterSet. It can be the IP address or a DNS name reachable from the `mysqlshell-runner` Pod. |
| 122 | + |
| 123 | +The `port` is MySQL port. Defaults to `3306`. |
| 124 | + |
| 125 | + |
| 126 | +| Value type | Example | |
| 127 | +| ---------- | ------- | |
| 128 | +| :material-text-long: subdoc | <pre>- host: ps-cluster1-mysql-primary.default.svc.cluster.local<br> port: 3306</pre> | |
| 129 | + |
| 130 | +### `spec.createReplicaClusterOptions.recoveryMethod` |
| 131 | + |
| 132 | +Preferred method for seeding the first member of a new replica cluster when it joins the ClusterSet. |
| 133 | + |
| 134 | +Supported values: |
| 135 | + |
| 136 | +* `clone` — Physical snapshot via MySQL CLONE plugin. **Default.** Best for small datasets and low-latency networks. |
| 137 | +* `incremental` — Apply GTID delta only. Use after restoring a backup from the primary into the replica. Best for large datasets or WAN links. |
| 138 | + |
| 139 | +When you omit this field, the Operator uses `clone`. |
| 140 | + |
| 141 | +| Value type | Example | |
| 142 | +| ---------- | ------- | |
| 143 | +| :material-code-string: string | `clone` | |
| 144 | + |
| 145 | + |
| 146 | +### `spec.mysqlshellRunner.image` |
| 147 | + |
| 148 | +Container image for the `mysqlshell-runner` Pod and ClusterSet Jobs. Must contain `mysqlsh` on `PATH`. The mysqlsh major version must match the MySQL endpoints (8.0 endpoints → 8.0 image, 8.4 endpoints → 8.4 image). |
| 149 | + |
| 150 | +| Value type | Example | |
| 151 | +| ---------- | ------- | |
| 152 | +| :material-code-string: string | `percona/percona-server:{{ ps84recommended }}` | |
0 commit comments