Andrei Kvapil 8346e98d24 feat(redis-operator): apply a minted password without a restart
The operator reads the auth Secret on every reconcile but applies the
password only through redis.conf, which a server reads at start, and
everything it runs authenticated with that client password. A changed
Secret therefore moved the operator, the Sentinels and any restarted pod
onto the new password while every running server still required the old
one, and rolling the pods to fix that deleted the master: about 30 s of
failed writes per mint on Redis and Valkey alike. Platform-minted
credentials rewrite that Secret, so a mint has to be cheap.

Replication, the Sentinels, the probes and the shutdown hook
authenticate as an internal ACL user, rf-internal, and the exporter as a
user of its own, rf-exporter, both kept in the operator's own Secret.
The auth Secret's password belongs to the default user alone, so a mint
applies it on every running server: no restart and no failover. An
existing RedisFailover gets both users live on every server and Sentinel
before its ConfigMap and pod template switch to them, which rolls its
pods once.

The client password can read masterauth with CONFIG GET, so rf-internal
has two passwords. The pod password, which the probes and the shutdown
hook read from their environment at start, is on the servers only as a
SHA-256 hash in the ACL, never appears in CONFIG, and stays fixed, since
changing it would restart those containers. The link password, which
masterauth and the Sentinels' auth-pass carry, is rotated on every
change of the client password. The stages keep the old link password
valid until no server, replica or Sentinel uses it, and the ConfigMap
records the new client password only after that, so a completed revoke
leaves the old link password valid nowhere. Each stage reads before it
writes and the Secret records progress, so a pass that stops anywhere is
finished by the next one. rf-internal may run only what replication, the
Sentinels, the probes and the shutdown hook send, on the Sentinels'
hello channel alone, and has no CONFIG GET; rf-exporter may run only
what redis_exporter sends.

CONFIG SET requirepass alone would leave every connection that
authenticated with the old password open, and the default user may run
CONFIG GET requirepass, so a holder of a leaked password could keep one
connection across a mint or revoke and read the new password from it. A
client password change is therefore one MULTI/EXEC per server: reset the
operator's users, delete any other user, set requirepass, and kill every
connection of the default and exporter users. No connection made with
the old password, or with a password its holder added to an operator
user, sees the new one. Replication and Sentinel links and the liveness
probe stay up. A server is changed only while it still takes the old
password, so a pass that stops halfway resumes on the servers left.

A connection that needs no new password can still outlive a revoke: a
replication stream opened as rf-internal with the link password read
from masterauth, or a MONITOR, which ACL checks only when it starts. The
link rotation therefore ends, before it is recorded as done, by killing
every MONITOR and every operator-user connection from an address that is
no pod of the RedisFailover and not loopback.

For the roll that switches an existing RedisFailover, and any other, the
operator moves the master role off a stale master with SENTINEL FAILOVER
and relabels the pods before rolling it as a replica, so writes stop
only for the failover rather than until the Sentinels notice a deleted
master. The roll reports a moved master and the pass ends there, so the
next pass starts from the new master instead of pointing the Sentinels
back at the old one. When a quorum of Sentinels names one of two
masters, the other becomes its replica; with no quorum the operator asks
for a manual fix.

The tenant's default user can run ACL, CONFIG and, on the
unauthenticated Sentinels, SENTINEL SET, so the operator does not trust
its own setup to stay. Every pass reads the operator's users with ACL
GETUSER and resets one that is missing, disabled, has another password,
other rules or an extra selector, checks masteruser/masterauth with
CONFIG GET, and re-sends a Sentinel's auth-user/auth-pass when CLIENT
LIST shows it connected as another user, since SENTINEL SET cannot be
read back. Between passes a guard checks the internal user on every
server every 2 s from what the last pass left in memory, with no API
call, and resets it and every Sentinel's auth where it differs, well
before a tenant's ACL DELUSER rf-internal on the master would make the
Sentinels fail it over, about 9 s later.

Every rotation and every guard run also deletes any ACL user but
default, rf-internal, rf-exporter and the liveness probe's pinger, which
disconnects clients authenticated as them, since such a user would keep
a tenant in after a revoke. Nothing a tenant changes outlives a restart,
because redis reads redis.conf from the read-only ConfigMap volume and
no aclfile is configured. Every mint and revoke disconnects the tenant's
clients. The redis-tls e2e reads INFO replication as REDIS_USER, since
the redis container's REDIS_PASSWORD is now rf-internal's.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-12-02 20:38:09 +01:00
2026-11-04 00:56:56 +01:00
2025-10-08 09:43:34 +05:00
2024-02-08 12:04:32 +01:00

Cozystack Cozystack

GitHub Release Apache-2.0 License Commit activity OpenSSF Best Practices OpenSSF Scorecard CLOMonitor Support

Cozystack

Cozystack is a free and open-source platform and framework for building clouds.

Cozystack is a CNCF Sandbox project that was originally built and sponsored by Ænix.

With Cozystack, you can transform a bunch of servers into an intelligent system with a simple REST API for spawning Kubernetes clusters, Database-as-a-Service, virtual machines, load balancers, HTTP caching services, and other services with ease.

Use Cozystack to build your own cloud or provide a cost-effective development environment.

Cozystack user interface

Use-Cases

Documentation

The documentation is located on the cozystack.io website.

Read the Getting Started section for a quick start.

If you encounter any difficulties, start with the troubleshooting guide and work your way through the process that we've outlined.

Versioning

Versioning adheres to the Semantic Versioning principles.
A full list of the available releases is available in the GitHub repository's Release section.

Contributions

Contributions are highly appreciated and very welcomed!

In case of bugs, please check if the issue has already been opened by checking the GitHub Issues section. If it isn't, you can open a new one. A detailed report will help us replicate it, assess it, and work on a fix.

You are welcome to take on the fix yourself. Commits are used to generate the changelog, and their author will be referenced in it.

If you have a concrete feature request, open an issue. For a cross-cutting or architectural change, open a design proposal in the community repo. For questions or early ideas, use GitHub Discussions. See CONTRIBUTING.md for the full routing.

Community

You are welcome to join us in #cozystack, on either CNCF Slack (get an invite) or Kubernetes Slack (get an invite), in our Telegram group, and at our community meetings. Add them to your Google Calendar or iCal for convenience.

Project documents

Document What it covers
Governance How decisions are made and who makes them
Contributor Ladder How to grow from contributor to maintainer
Maintainers Who maintains the project
Code of Conduct What we expect of each other
Security Policy Reporting a vulnerability, and which releases get fixes
Adopters Who runs Cozystack in production
Roadmap Where the project is going

License

Cozystack is licensed under Apache 2.0.
The code is provided as-is with no warranties.

Commercial Support

A list of companies providing commercial support for this project can be found on official site.

Languages
Go 53.3%
Shell 33.1%
TypeScript 6.6%
Go Template 4.7%
Makefile 1.2%
Other 1%