feat(redis)!: issue the password through the credentials API

The chart generated the password of the default user itself, kept it
readable by the tenant in <release>-auth, and shared it with
replication, the Sentinels, the exporter and backups. It now renders a
CredentialTemplate for the default account while authEnabled is on, and
points the operator at that account's Secret, which the platform seeds
and rewrites on a mint and which the tenant cannot read.

The operator keeps replication, the Sentinels, the probes and the
exporter on an internal account of its own, so the minted password
reaches only the servers' default user and the backup Job, which is why
the backup strategy reads the same Secret, and a mint restarts no pod.
The ResourceDefinition no longer selects <release>-auth and excludes the
internal account's Secret, which carries an ownerReference to the
RedisFailover, so the tenant-visible set holds the trust anchor alone.
The e2e mint step fails if a mint restarts a pod or moves the master.

BREAKING CHANGE: <release>-auth is no longer rendered or readable;
clients get the password by minting the default credential.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
This commit is contained in:
Andrei Kvapil committed 2026-12-02 20:38:25 +01:00
1 parent 8346e98d24
commit 0999d9cfd2
15 files changed
+248 -52

No files matched your search

+1 -1
View File
@@ -46,7 +46,7 @@ type ConfigSpec struct {
// TLS configuration. TLS is opt-in and is not inferred from `external`.
// +kubebuilder:default:={}
Tls TLS `json:"tls,omitempty"`
// Enable password generation.
// Require a password. The password of the `default` user is issued through the credentials API, and issuing a new one takes effect without restarting anything. Replication, the Sentinels and the metrics exporter use an internal account of their own; backups use the `default` password.
// +kubebuilder:default:=true
AuthEnabled bool `json:"authEnabled"`
// Redis `min-replicas-to-write`: the master refuses writes unless at least this many replicas are connected and within `minReplicasMaxLag`. Unset by default, which leaves the Redis default (disabled). With `replicas: 2` and a value of 1 the master rejects writes while its only replica is down, trading availability for a bound on the writes lost if an isolated master is failed over. Replication stays asynchronous, so this bounds the loss, it does not remove it. Must be 0 or more and below `replicas` (a master with `replicas` pods has `replicas - 1` replicas), otherwise every write is refused; the chart refuses such a value.