{
  "id": "rack-awareness",
  "title": "Rack awareness examples",
  "url": "https://redis.io/docs/latest/operate/kubernetes/8.0/reference/yaml/rack-awareness/",
  "summary": "YAML examples for rack-aware Redis Enterprise deployments that distribute nodes across availability zones.",
  "content": "\nThis page provides YAML examples for deploying Redis Enterprise with [rack awareness](https://redis.io/docs/latest/operate/kubernetes/recommendations/node-selection#using-rack-awareness). Rack awareness distributes Redis Enterprise nodes and database shards across different availability zones or failure domains to improve high availability and fault tolerance.\n\n## Prerequisites\n\n- Label [Kubernetes nodes](https://kubernetes.io/docs/concepts/architecture/nodes/) with zone information\n- Typically uses the standard label `topology.kubernetes.io/zone`\n- Verify node labels: `kubectl get nodes -o custom-columns=\"name:metadata.name\",\"rack\\\\zone:metadata.labels.topology\\.kubernetes\\.io/zone\"`\n- Install the [Redis Enterprise operator](https://redis.io/docs/latest/operate/kubernetes/deployment)\n\nFor complete deployment instructions, see [Deploy on Kubernetes](https://redis.io/docs/latest/operate/kubernetes/deployment).\n\n## Service account\n\nThe service account for rack-aware deployments is the same as [basic deployments](https://redis.io/docs/latest/operate/kubernetes/reference/yaml/basic-deployment#service-account).\n\n\n\n## Cluster role\n\nRack awareness requires additional permissions to read [node labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) across the cluster.\n\n\n\nCluster role configuration:\n\n- `name`: ClusterRole name for rack awareness permissions\n- `rules`: Permissions to read nodes and their labels cluster-wide\n- `resources`: Access to `nodes` resource for zone label discovery\n\nKey permissions:\n\n- `nodes`: Read access to discover node zone labels\n- `get, list, watch`: Monitor node changes and zone assignments\n\n## Cluster role binding\n\nThe [ClusterRoleBinding](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#rolebinding-and-clusterrolebinding) grants cluster-wide permissions to the service account.\n\n\n\nCluster role binding configuration:\n\n- `subjects.name`: Must match the service account name\n- `subjects.namespace`: Namespace where the operator is deployed\n- `roleRef.name`: Must match the cluster role name\n\n## Rack-aware Redis Enterprise cluster\n\nThe rack-aware [REC configuration](https://redis.io/docs/latest/operate/kubernetes/reference/api/redis_enterprise_cluster_api) includes the `rackAwarenessNodeLabel` field.\n\n\n\nRack-aware cluster configuration:\n\n- `metadata.name`: Cluster name (cannot be changed after creation)\n- `spec.rackAwarenessNodeLabel`: Node label used for zone identification\n- `spec.nodes`: Minimum 3 nodes, ideally distributed across zones\n\nEdit the values in the downloaded YAML file based on your environment, such as increasing nodes for better zone distribution, using custom zone labels, adding resource specifications, or enabling persistent storage.\n\n### Common zone labels\n\nDifferent Kubernetes distributions use different zone labels:\n\n- `Standard`: `topology.kubernetes.io/zone`\n- `Legacy`: `failure-domain.beta.kubernetes.io/zone`\n- `Custom`: Your organization's specific labeling scheme\n\nVerify the correct label on your nodes:\n\n```bash\nkubectl get nodes -o custom-columns=\"name:metadata.name\",\"rack\\\\zone:metadata.labels.topology\\.kubernetes\\.io/zone\"\n```\n\n## Redis Enterprise database\n\nDatabase configuration for rack-aware clusters is the same as [basic deployments](https://redis.io/docs/latest/operate/kubernetes/reference/yaml/basic-deployment#redis-enterprise-database).\n\n**Important**: For rack awareness to be effective, ensure your database has replication enabled. Rack awareness distributes primary and replica shards across zones, so databases without replication will not benefit from zone distribution.\n\n\n\n## Apply the configuration\n\nTo deploy rack-aware Redis Enterprise clusters, follow [Deploy on Kubernetes](https://redis.io/docs/latest/operate/kubernetes/deployment) and ensure your Kubernetes nodes have proper zone labels. For detailed rack awareness configuration, see the [node selection recommendations](https://redis.io/docs/latest/operate/kubernetes/recommendations/node-selection).\n\n## Troubleshooting\n\n### Nodes not distributed across zones\n\n- Verify node labels are correct\n- Check that sufficient nodes exist in each zone\n- Ensure the `rackAwarenessNodeLabel` matches actual node labels\n\n### Cluster role permissions denied\n\n- Verify the ClusterRole and ClusterRoleBinding are applied\n- Check that the service account name matches in all resources\n\n### Database shards not distributed\n\n- Confirm the cluster has rack awareness enabled\n- **Check that the database has replication enabled** - rack awareness distributes primary/replica pairs across zones\n- Verify the database has multiple shards\n- Ensure sufficient nodes exist across zones\n\n## Next steps\n\n- [Configure Active-Active databases](https://redis.io/docs/latest/operate/kubernetes/reference/yaml/active-active)\n- [Set up multi-namespace deployment](https://redis.io/docs/latest/operate/kubernetes/reference/yaml/multi-namespace)\n- [Learn about database replication](https://redis.io/docs/latest/operate/kubernetes/re-databases/replica-redb)\n\n## Related documentation\n\n- [Node selection recommendations](https://redis.io/docs/latest/operate/kubernetes/recommendations/node-selection)\n- [REC API reference](https://redis.io/docs/latest/operate/kubernetes/reference/api/redis_enterprise_cluster_api)\n- [REDB API reference](https://redis.io/docs/latest/operate/kubernetes/reference/api/redis_enterprise_database_api)\n- [Kubernetes node affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/)\n- [Redis Enterprise cluster architecture](https://redis.io/docs/latest/operate/kubernetes/architecture)\n",
  "tags": ["docs","operate","kubernetes"],
  "last_updated": "2026-06-04T14:49:57+01:00"
}
