Skip to content

feat: add a redis chart for DSS form sessions and wire DSS_REDIS_URL - #136

Merged
RohanReddy44 merged 2 commits into
developmentfrom
feat/207-redis-chart
Nov 17, 2026
Merged

RohanReddy44 merged 2 commits into
developmentfrom
feat/207-redis-chart

Conversation

@RohanReddy44

@RohanReddy44 RohanReddy44 commented Nov 16, 2026 •

Copy link
Copy Markdown

What

  • New redis chart: one Redis pod, password required, in memory only. Built from template on common, like qdrant and minio.
  • decision-support-system 0.3.0: redis.urlSecret.{name,key,optional} renders DSS_REDIS_URL from a Secret.
  • For the DSS's form-session state (DSS ADR-0022): which form is waiting for an OTP, and the per-session lock.

Why

  • The DSS holds form state between turns in Redis (DSS_REDIS_URL). Without one, a form that needs an OTP cannot finish.
  • Only docker compose could run that Redis so far.

The redis chart

  • Same command as the DSS compose file: requirepass, --save "", --appendonly no. Adds --maxmemory 100mb and allkeys-lru, so Redis evicts instead of being OOM-killed.
  • Nothing on disk: no volume, read-only root filesystem. A restart comes back empty, and open form flows are lost; ADR-0022 accepts that.
  • One replica, fixed, with Recreate. Failover is Kubernetes restarting the pod. No replication, Sentinel or operator in this first pass.
  • Password from an existing Secret (auth.existingSecret). The chart renders no Secret and refuses to render without one.
  • The password is never on a command line: the server reads it as config on stdin, and redis-cli (probes, kubectl exec) reads REDISCLI_AUTH.
  • NetworkPolicy, on by default: only DSS pods may connect on 6379. ClusterIP only, no Ingress.
  • No TLS: ADR-0022 asks for it, and this first pass goes without it. The NetworkPolicy and the password are what limit access.
  • Runs as the image's redis user (uid 999, gid 1000), all capabilities dropped, no service-account token.
  • Liveness waits for six misses before restarting, since a restart empties the store.

The DSS chart (0.3.0)

  • redis.urlSecret: {name, key: url, optional: false} renders a secretKeyRef for DSS_REDIS_URL. Off by default.
  • optional: true lets the pod start while the Secret is still missing, the same as no store.
  • The README no longer calls the DSS stateless without qualification: form sessions and their cross-replica lock live in Redis.

Testing

  • helm lint --strict passes on Helm v3.16.4 (the CI version) for every CI values file of both charts.
  • Render guards: no auth.existingSecret fails; NetworkPolicy on with no peers fails; urlSecret.name without a key fails.
  • On a local kind cluster, from empty: cert-manager, OpenBao, ESO, Reflector, then this chart and the DSS chart. The Secret is generated by manage-secrets.py and delivered through OpenBao, ESO and Reflector.
    • Redis: redis-cli ping works via REDISCLI_AUTH; with no password it gets NOAUTH; PID 1's command line shows no password.
    • NetworkPolicy: a plain pod is blocked, a pod with the DSS label connects.
    • DSS v0.2.0: DSS_REDIS_URL comes from the Secret, and the image's redis-py pings and sets/gets through it.
    • optional: true with a missing Secret: the pod starts and DSS_REDIS_URL is unset. Without optional: CreateContainerConfigError.
    • Rotation: the Secret updates by itself, but the pods don't. Both must be restarted together, as documented.
  • Not tested on EKS. The Argo CD Application, the OpenBao secret and the DSS values are in OpenAgriNet/infra-automation#47.

Open

  • Image licence: Redis 7.4 is RSALv2/SSPLv1. 8.x (AGPLv3 option), 7.2 (BSD) or Valkey (BSD) are open-source alternatives. Pending a team decision; it's a one-line appVersion change.

Relates to OpenAgriNet/engineering-tracker#207

…/engineering-tracker#207]

One Redis pod for decision-support-system's form-session state (DSS
ADR-0022): password from an existing Secret, nothing saved to disk, no
volume, restarts empty. Kubernetes restarting the pod is the failover; no
replication, Sentinel or operator in this first pass. No TLS.
…penAgriNet/engineering-tracker#207]

decision-support-system 0.3.0:
- redis.urlSecret.{name,key,optional} renders DSS_REDIS_URL from a Secret.
  optional lets the pod start while the Secret is still missing, as if unset.
- README and description: form sessions and their cross-replica lock live
  in Redis; the DSS is no longer described as stateless without qualification.

redis (unreleased 0.1.0):
- NetworkPolicy, on by default: only DSS pods may connect on 6379. The render
  fails if it is on with no peers.
- The password never goes on a command line: the server reads it as config
  on stdin, redis-cli reads REDISCLI_AUTH.
- Liveness waits for six misses before a restart, which empties the store.
- README and example use the dss namespace, the FQDN URL, redis.urlSecret,
  and document rotation (restart redis and the DSS together).
@RohanReddy44 RohanReddy44 changed the title feat: add a single-pod redis chart for DSS form sessions feat: add a redis chart for DSS form sessions and wire DSS_REDIS_URL Nov 17, 2026
urlSecret:
name: dss-redis
key: url
optional: true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for now yes
but eventually once I refactor DSS to always expect redis, I will switch it to False

@RohanReddy44
RohanReddy44 merged commit e1ca3e6 into development Nov 17, 2026
1 check passed
@RohanReddy44
RohanReddy44 deleted the feat/207-redis-chart branch November 17, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants