[redis] Migrate live RW consumers off bare redis.redis hostname

Completes the T0 hostname migration. The `redis.redis` service is a
legacy alias that routes to HAProxy via a `null_resource` selector
patch; `redis-master.redis` is the canonical name that has always
routed to HAProxy directly and health-checks master-only.

Changes:
- redis-backup CronJob: redis-cli BGSAVE + --rdb now target
  redis-master.redis. BGSAVE runs on the master (what we want).
- config.tfvars `resume_redis_url`: unused fallback updated for
  grep hygiene; nothing reads it today.
- ytdlp REDIS_URL default: updated for dev-local runs; production
  already sets REDIS_URL via main.tf:283-285 → var.redis_host.
- immich chart_values.tpl REDIS_HOSTNAME: dead Helm template (values
  block commented out in main.tf:524, Immich deploys as raw
  kubernetes_deployment using var.redis_host). Updated to keep the
  file consistent if someone ever revives it.
This commit is contained in:
Viktor Barzin 2026-04-19 12:42:36 +00:00
parent e6e5fc5f17
commit 12a372bf92
4 changed files with 4 additions and 4 deletions

Binary file not shown.

View file

@ -9,7 +9,7 @@ defaultPodOptions:
env:
# REDIS_HOSTNAME: '{{ printf "%s-redis-master" .Release.Name }}'
REDIS_HOSTNAME: "redis.redis.svc.cluster.local"
REDIS_HOSTNAME: "redis-master.redis.svc.cluster.local"
# DB_HOSTNAME: "postgresql.dbaas"
# DB_USERNAME: "immich"
# DB_DATABASE_NAME: "immich"

View file

@ -366,10 +366,10 @@ resource "kubernetes_cron_job_v1" "redis-backup" {
TIMESTAMP=$(date +%Y%m%d-%H%M)
# Trigger a fresh RDB save on the master
redis-cli -h redis.redis BGSAVE
redis-cli -h redis-master.redis BGSAVE
sleep 5
# Copy the RDB via redis-cli --rdb
redis-cli -h redis.redis --rdb /backup/redis-$TIMESTAMP.rdb
redis-cli -h redis-master.redis --rdb /backup/redis-$TIMESTAMP.rdb
# Rotate 28-day retention
find /backup -name 'redis-*.rdb' -type f -mtime +28 -delete

View file

@ -133,7 +133,7 @@ SLACK_BOT_TOKEN = os.getenv("SLACK_BOT_TOKEN", "")
SLACK_CHANNEL = os.getenv("SLACK_CHANNEL", "automation")
# Redis configuration
REDIS_URL = os.getenv("REDIS_URL", "redis://redis.redis.svc.cluster.local:6379/0")
REDIS_URL = os.getenv("REDIS_URL", "redis://redis-master.redis.svc.cluster.local:6379/0")
REDIS_PREFIX = "yt-highlights:"
# Paths