Redis on OpenShift
Choose Redis Enterprise, community Redis or Valkey, then deploy a Redis with the OpsTree operator and confirm it answers PING.
The overview treats Redis as a protocol and a set of structures. On OpenShift you still have to pick a distribution and an operator. Three distributions speak the same core commands. They differ in licence, in who publishes the build, and in what the operator will do for failover, multi-site and support.
Three distributions
| Redis Enterprise | Community Redis | Valkey | |
|---|---|---|---|
| What it is | Redis Software, sold by Redis Ltd. | The Redis server you run yourself | A Linux Foundation project, forked from Redis 7.2.4 |
| Licence | Commercial subscription | From 7.4, dual RSALv2 and SSPL. 7.2 was the last BSD release | BSD-3-Clause |
| Current line, October 2026 | Operator 8.2.x, tested by Redis on OpenShift 4.22 | Redis 8.10 is current; 8.2 is the long-term line | 9.0.7 on the 9.0 line (9.1 is also published) |
| Operator | Redis Enterprise operator: RedisEnterpriseCluster, RedisEnterpriseDatabase |
OpsTree redis-operator: Redis, RedisReplication, RedisSentinel, RedisCluster |
No separate protocol. Run the Valkey image, or an operator whose image layout matches it |
| You would pick it for | A support contract, Active-Active (CRDB) across sites, the vendor operator | A Redis build on Kubernetes, with Sentinel or Cluster under an operator | The BSD-licensed continuation of the 7.2 server, same core commands |
"Community Redis" here means that Redis server, not Redis Enterprise. Valkey is command-compatible with it for the structures in the overview. Client libraries do not change when you move between them for GET, SET, hashes, lists, sets, sorted sets and streams. Modules, the query engine and Active-Active are where the products part company.
Prerequisites
- OpenShift 4.x and
oc, with permission to install an operator and to grant a Security Context Constraint in a lab namespace - Helm 3 on the workstation
- The cluster can pull
quay.io/opstree/redis-operatorandquay.io/opstree/redis, or those images are already in your mirror
oc whoami
helm version
Install the operator
The hands-on path below is community Redis through the OpsTree operator. Redis Enterprise follows the same shape and is a second manifest, for a cluster that has the subscription.
helm repo add ot-helm https://ot-container-kit.github.io/helm-charts/
helm upgrade --install redis-operator ot-helm/redis-operator \
--namespace redis-operator --create-namespace
oc get pods -n redis-operator
oc get crd | grep opstreelabs
Wait until the operator pod is Running. The CRD list should include the Redis resources (redis.redis.opstreelabs.in).
A single Redis
oc new-project cache
oc adm policy add-scc-to-user anyuid system:serviceaccount:cache:default
anyuid lets the pod run as UID 1000, which is what the upstream samples set. OpenShift would otherwise reject that UID because it sits outside the namespace range. anyuid is acceptable in this lab project and too broad on a shared cluster. The security lab is where that gets narrowed. A disconnected cluster must mirror quay.io/opstree/redis before the pod can start. Tag v8.2.1 is a real 8.2 image on that repository; move the tag forward to the patch your operator release lists.
cache.yaml:
apiVersion: redis.redis.opstreelabs.in/v1beta2
kind: Redis
metadata:
name: cache
namespace: cache
spec:
podSecurityContext:
runAsUser: 1000
fsGroup: 1000
kubernetesConfig:
image: quay.io/opstree/redis:v8.2.1
imagePullPolicy: IfNotPresent
resources:
requests: {cpu: 100m, memory: 128Mi}
limits: {cpu: "1", memory: 1Gi}
storage:
volumeClaimTemplate:
spec:
accessModes: ["ReadWriteOnce"]
resources: {requests: {storage: 2Gi}}
oc apply -f cache.yaml
oc get redis -n cache
oc rollout status statefulset/cache -n cache
oc exec -n cache cache-0 -- redis-cli PING
PONG is the whole success criterion. The Service is named cache and listens on 6379 inside the cluster. A pod in another namespace reaches it at cache.cache.svc:6379. There is no password yet: a ClusterIP stops traffic from outside the cluster, and it does not stop another pod. Add a password before a second team shares the cluster. The security lab uses ACLs and TLS. Until then, keep this project to yourself.
If the pod stays Pending, oc describe pod -n cache cache-0 usually shows a missing StorageClass or an SCC denial. A PVC that never binds is a storage problem: the ONTAP Select and Trident labs are how this cluster hands out volumes.
Redis Enterprise
Install the certified Redis Enterprise operator from OperatorHub into a namespace such as redis-enterprise. The cluster resource is small; the operator fills in the images from the subscription you installed.
apiVersion: app.redislabs.com/v1
kind: RedisEnterpriseCluster
metadata:
name: rec
namespace: redis-enterprise
spec:
nodes: 3
persistentSpec:
enabled: true
volumeSize: 20Gi
---
apiVersion: app.redislabs.com/v1alpha1
kind: RedisEnterpriseDatabase
metadata:
name: cache
namespace: redis-enterprise
spec:
memorySize: 256MB
redisEnterpriseCluster:
name: rec
Three nodes is the smallest cluster that can lose one and keep the database up. The database object is what clients use: memory limit, replication, modules and, when you buy it, Active-Active across clusters. Confirm the CRDs with oc get crd | grep redislabs before applying. The rest of this series uses redis-cli commands that work against the database Service this operator creates.
Valkey
Valkey is the same protocol. The image we pin is valkey/valkey:9.0.7. The OpsTree operator's published images are Redis images, with an entrypoint and a user the operator's scripts expect, so swapping in the Valkey image on the Redis resource is not a supported switch. Run Valkey as its own StatefulSet when you want that build, and point the same clients at it.
oc exec -n cache cache-0 -- redis-cli INFO server | awk -F: '/redis_version/{print $2}'
A Valkey pod reports a Valkey version from valkey-cli INFO server. The caching and high-availability labs use the cache Service from this page. Either distribution can back them.
What's next
Caching puts a PostgreSQL read behind this Redis. High availability replaces the single pod with Sentinel or Cluster. Crunchy Postgres is the system of record those cache keys are copied from.