Skip to content

feat(openhands): PLTF-1247 migrate embedded Redis to Valkey - #973

Closed
aivong-openhands wants to merge 8 commits into
mainfrom
pltf-1247-migrate-redis-to-valkey
Closed

aivong-openhands wants to merge 8 commits into
mainfrom
pltf-1247-migrate-redis-to-valkey

Conversation

@aivong-openhands

@aivong-openhands aivong-openhands commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Why

Bitnami's license change froze the free Redis chart and images, so the pinned redis 20.3.0 and bitnamilegacy/redis get no CVE patches and the index is not guaranteed to stay reachable. This swaps the embedded cache to the official Valkey chart (0.11.0, BSD-3-Clause), keeping the existing redis / redis-password secret and the REDIS_* variable names so operators create nothing new and the app needs no code change. Cutover discards the cache, which invalidates in-flight OAuth and Slack flows and briefly cold-starts the identity caches.

Consumers that pin cache settings must translate them in the same change. The values key becomes valkey:, and a leftover redis: block is silently ignored rather than rejected. All four internal SaaS environments pin redis.master.resources and none define valkey:, so a chart bump alone would quietly drop production's cache from 500m/1Gi to the chart defaults of 100m/128Mi. The chart README now carries the key-by-key translation, a copy-paste block, and the rollback command.

This is a narrower second attempt at #521, whose Valkey values shape, service rename and support-bundle changes carry over here. That one spanned 33 files because it bundled a CloudNativePG Postgres migration alongside the cache swap, and it renamed the secret to valkey / valkey-password with matching changes to openhands-secrets. Keeping the existing secret name is the deliberate reversal: openhands-secrets stays untouched, and no install has to create a secret before upgrading or retain the old one in order to revert.

Validation

  • Upgrade and rollback on every consumer surface — 0.28.0 to this change and back, on published charts, on the Replicated registry via the customer path (install from Stable, switch channel, upgrade), and on Embedded Cluster. Each direction confirmed by a completed conversation writing rate-limiter keys into the live cache.
  • The credential survives untouched — the redis secret's uid and value hash were identical after every upgrade and rollback on both surfaces, so no install needs a new secret and no revert needs the old password recovered.
  • Nothing is left pointing at the old workload — the support-bundle analyzer moved from statefulsetStatus on openhands-redis-master to deploymentStatus on openhands-valkey and back on revert, no StatefulSet, service or PVC survives the swap, and no subchart carries cache configuration of its own.
  • A stale redis: block is silently ignored — the upgrade succeeds and serves conversations, but the cache runs on chart defaults instead of the pinned values (100m in place of 50m). Nothing warns, because the values schema constrains neither key. This is the basis for the consumer note above.
  • The added unit tests fail when the change is reverted — verified by mutating the templates: restoring the old service name breaks the cache-env assertion, and restoring statefulsetStatus breaks both the analyzer test and the guard against any lingering openhands-redis-master reference.

This PR was drafted by an AI agent on behalf of the user.

@github-actions github-actions Bot added the type: feat A new feature label Jul 27, 2026
Replace the frozen Bitnami redis 20.3.0 dependency with the official
valkey chart 0.11.0 from https://valkey.io/valkey-helm/.

Retain the `redis` / `redis-password` secret via auth.usersExistingSecret
and aclUsers.default.passwordKey so existing installs keep their
credential across the upgrade and rollback needs no re-derivation.
REDIS_* env var names stay because application code reads them.

Valkey renders a Deployment, so the support bundle analyzer moves from
statefulsetStatus to deploymentStatus. The redis collector type is kept
because Valkey speaks RESP and `default` is the ACL user.

CI gains `helm repo add valkey` in the two workflows that run
`helm dependency build`; the valkey repo is HTTP, not OCI.
@aivong-openhands
aivong-openhands force-pushed the pltf-1247-migrate-redis-to-valkey branch from 9da9063 to 47bd75d Compare July 27, 2026 18:36
The exec probe's `valkey-cli ping` exits 0 even when the server replies
NOAUTH, so it gates on port reachability only and cannot flap under ACL
enforcement. Verified on a KinD cluster: 0 restarts, no Unhealthy events.
… tests

Migration notes in the chart README: the `redis` Secret is unchanged and
needs no action, while a values file with a `redis:` block must be
translated because a stale block is ignored without warning and the cache
silently falls back to chart defaults.

Replace the "Bring Your Own Redis" section, which documented
`externalRedis` keys that exist in no template. The working mechanism is
`valkey.enabled: false` plus `REDIS_*` env overrides, and it applies to
Helm installs only since Embedded Cluster always uses the bundled cache.

Unit tests cover the cache env wiring, the retained secret reference, the
disabled path, the support-bundle Deployment analyzer, and the absence of
any reference to the removed Bitnami workload.
@aivong-openhands
aivong-openhands marked this pull request as ready for review July 28, 2026 16:30
…rt README

The chart README covers Helm installs; the Admin Console path belongs in
the Replicated install docs.
Comments and docs in the shipped files now state the current
configuration and the action a consumer needs to take. The migration
history belongs in the pull request, not in the chart.

The `redis` values key and secret name still appear where they are
load-bearing: the translation table a consumer follows, and the retained
secret reference.
External cache support on Embedded Cluster is expected to change, so
documenting today's limitation would go stale without anything flagging
it.
@aivong-openhands

Copy link
Copy Markdown
Contributor Author

Closing in favor or #1007 and #1008 to first ship a chart that defaults valkey to off

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feat A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants