19f7afac92
Activates the arr forks (sonarr/radarr/prowlarr) #14 Redis features — SignalR backplane, cross-replica cache-invalidation bus, and distributed rate limiter — which ship deployed but inert because no Valkey exists in arrstack and nothing is wired to it. Ben wants ONE Valkey shared by all three apps. ## Changes - Adds a single shared `ValkeyCluster` (`arrstack-valkey`) under `apps/base/arrstack/valkey/`, modeled on `jellyfin-valkey`: `shards:1`/`replicas:2` HA (one primary + two replicas, automatic failover), image via artifactapi (`artifactapi.k8s.syd1.au.unkin.net/dockerhub/valkey/valkey:9.0.0`), operator-default passwordless `default` user, node spread across hosts, cluster-aware PDB, ephemeral `/data`. - Registers the `valkey` component in the arrstack base kustomization. - Wires `<App>__Redis__Host` + `<App>__Redis__Port` into the `sonarr-env` / `radarr-env` / `prowlarr-env` ConfigMaps, all pointing at the shared service `valkey-arrstack-valkey.arrstack.svc.cluster.local:6379`. ## Notes - Setting `Host` is the activation switch: the fork's `RedisOptions.IsConfigured` gates purely on a non-empty `Host`, so there is no separate Enabled flag. - Passwordless (jellyfin parity — the operator leaves the `default` user without auth), so no `Password`/`Ssl` is wired and there is no secret to reference. - One cluster is safe for all three: each fork namespaces its keys and pub/sub channels by a per-app prefix (`sonarr:ratelimit:` / `radarr:ratelimit:` / `prowlarr:ratelimit:`), so their state never collides. - App `image:` (-unkin5), the waitfordb initContainer, and S3 buckets are untouched. - Validated: `kubectl kustomize` renders clean for both `apps/base/arrstack` and `apps/overlays/au-syd1/arrstack`. Follow-up: after merge, Valkey must come up and the three apps must roll (pick up the new env) before the #14 features can be validated live. --------- Co-authored-by: Ben Vincent <ben@unkin.net> Reviewed-on: #394 Co-authored-by: Unkin Agent <unkin-agent@unkin.net> Co-committed-by: Unkin Agent <unkin-agent@unkin.net>
48 lines
1.9 KiB
YAML
48 lines
1.9 KiB
YAML
---
|
|
# Single shared HA Valkey for the arr apps (sonarr/radarr/prowlarr), managed by
|
|
# valkey-operator. It activates the fork's #14 Redis features: the SignalR
|
|
# backplane, the cross-replica cache-invalidation bus, and the distributed rate
|
|
# limiter. One cluster is safe for all three because each fork namespaces its
|
|
# keys and pub/sub channels by a per-app prefix (sonarr:ratelimit: /
|
|
# radarr:ratelimit: / prowlarr:ratelimit:), so their state never collides.
|
|
#
|
|
# Modeled on jellyfin-valkey: shards:1 + replicas:2 is one primary with two
|
|
# replicas in a single shard group (three ValkeyNodes total); losing the primary
|
|
# triggers an automatic failover so a node/pod loss no longer drops the shared
|
|
# state the app replicas coordinate through. The operator runs Valkey
|
|
# cluster-mode-enabled with protected-mode off and leaves the built-in `default`
|
|
# user passwordless, so clients connect with no auth/TLS; StackExchange.Redis
|
|
# seeds off the single service and auto-discovers topology plus failovers.
|
|
# scheduling.node.spread.shard:Required keeps the three nodes on distinct hosts,
|
|
# so one host loss removes at most one node; podDisruptionBudget.mode:Cluster
|
|
# lets the operator manage a quorum-aware PDB. Persistence is omitted (/data is an
|
|
# emptyDir): the coordination state is ephemeral (short TTLs / transient pub/sub),
|
|
# replication+failover already provide redundancy, and an operator-managed PVC
|
|
# cannot carry the k8up.io/backup:"false" annotation the namespace k8up Schedule
|
|
# needs to skip in-use RWO volumes.
|
|
apiVersion: valkey.io/v1alpha1
|
|
kind: ValkeyCluster
|
|
metadata:
|
|
name: arrstack-valkey
|
|
namespace: arrstack
|
|
spec:
|
|
shards: 1
|
|
replicas: 2
|
|
image: artifactapi.k8s.syd1.au.unkin.net/dockerhub/valkey/valkey:9.0.0
|
|
exporter:
|
|
enabled: false
|
|
scheduling:
|
|
node:
|
|
spread:
|
|
shard:
|
|
mode: Required
|
|
podDisruptionBudget:
|
|
mode: Cluster
|
|
resources:
|
|
requests:
|
|
cpu: 50m
|
|
memory: 128Mi
|
|
limits:
|
|
cpu: 500m
|
|
memory: 512Mi
|