Skip to main content
Enterprise

Redis Configuration

NetBox uses Redis for caching and as a task queue for background workers. The operator supports two modes:

  • Internal (default): Managed by the Redis Operator, installed as a chart dependency
  • External: Connect to an existing Redis instance

Internal Redis (Default)

When redis.external: false (the default), the operator deploys a Redis cluster managed by the Redis Operator.

KeyTypeDefaultDescription
redis.externalboolfalseUse internal Redis
redis.namestringredisRedis instance name
redis.clusterSizeuint80Number of Redis replicas. 0 auto-scales to min(nodes, 3) (0-255)
redis.persistencebooltrueEnable data persistence
redis.requireAuthboolfalseRequire authentication
redis.resources.cpuint-CPU request in millicores (optional)
redis.resources.memoryint-Memory request in MiB (optional)
redis.limits.cpuint-CPU limit in millicores (optional)
redis.limits.memoryint-Memory limit in MiB (optional)
redis.storageClassNamestring-Storage class for Redis PVCs
redis.storageSizestring1GiStorage size for Redis PVCs (when persistence is enabled)
note

When resources or limits are not set, no resource requests or limits are applied to Redis pods, allowing Kubernetes defaults. Set limits to prevent Redis from consuming excessive node resources.

Example with redundancy and resource limits:

netboxEnterprise:
spec:
redis:
external: false
clusterSize: 3
persistence: true
storageSize: "2Gi"
resources:
cpu: 250
memory: 256
limits:
cpu: 500
memory: 512

Memory and persistence tuning

These fields apply only to internal (operator-managed) Redis. They let you cap Redis memory, choose how it behaves when full, and control append-only file (AOF) persistence without rebuilding the operator.

KeyTypeDefaultDescription
redis.aofEnabledbool-Enable AOF persistence. false avoids the OOM restart loop -- a restart does not replay the AOF log to re-fill memory, and RDB snapshots still preserve the NetBox cache. true maximizes write durability. Omit to leave the Redis default unchanged.
redis.maxMemoryPercentuint8-Cap Redis memory at N% (0-100) of redis.limits.memory, emitted as a maxmemory directive. No-op when redis.limits.memory is unset.
redis.maxMemoryPolicyenum-Key eviction policy when maxmemory is reached: noeviction, allkeys-lru, volatile-lru, allkeys-random, volatile-random, volatile-ttl, allkeys-lfu, volatile-lfu. Defaults to noeviction (reject writes) when unset.
redis.dynamicConfiglist-Extra Redis config directives appended to the managed ConfigMap. Applied on the next pod roll, not live. Prefer the typed fields above where they cover the need.
redis.additionalConfigstring-Raw Redis config directives appended verbatim after the typed fields. Redis uses the last occurrence, so raw directives take precedence.
Redis restart on upgrade

Setting redis.dynamicConfig changes the managed ConfigMap, so the operator rolls the Redis pod once on upgrade to apply the directives. This is expected and needs no action.

To cap memory and avoid the OOM restart loop on a memory-limited cluster:

netboxEnterprise:
spec:
redis:
external: false
aofEnabled: false
maxMemoryPercent: 80
maxMemoryPolicy: allkeys-lru
limits:
cpu: 500
memory: 512

External Redis

Set redis.external: true to use an externally managed Redis instance.

When external, provide connection details through netbox.config.redis:

netboxEnterprise:
spec:
redis:
external: true

netbox:
config:
redis:
host: "redis.example.com"
port: 6379
username: "netbox" # Optional, Redis 6.0+ ACL
password:
name: redis-credentials
key: password

You can disable the Redis Operator entirely:

redis-operator:
enabled: false

TLS Configuration

Configure TLS for connections to external Redis:

KeyTypeDefaultDescription
redis.tlsConfig.insecureSkipVerifyboolfalseSkip TLS verification (dev only)
redis.tlsConfig.keychainCaCertificateslist-CA certificate names from tlsKeychain
redis.tlsConfig.keychainClientCertificatestring-Client certificate name from tlsKeychain

Example with TLS

netboxEnterprise:
spec:
redis:
external: true
tlsConfig:
keychainCaCertificates:
- my-redis-ca

tlsKeychain:
caCertificateSecrets:
- name: my-redis-ca
secret: redis-ca-cert
key: ca.crt

Redis Database Allocation

NetBox and Diode use separate Redis databases within the same instance:

DatabasePurpose
0Diode reconciler
1Diode ingester streams
DefaultNetBox caching and task queue

These database numbers are configurable in the Diode configuration section.

Next Steps

  • Diode - Data ingestion pipeline that uses Redis streams
  • PostgreSQL - Database configuration