Affinity and Tolerations not applied to ValkeyReplication pods from ValkeySentinel configuration
search cancel

Affinity and Tolerations not applied to ValkeyReplication pods from ValkeySentinel configuration

book

Article ID: 437188

calendar_today

Updated On:

Products

VMware Tanzu Data Suite VMware Tanzu for Valkey

Issue/Introduction

When deploying Valkey using the Valkey Operator, users may observe that affinity and tolerations defined in the ValkeySentinel resource are applied only to the Sentinel StatefulSet, but not to the ValkeyReplication (data) StatefulSet.

As a result:

  • Sentinel pods are scheduled according to the defined affinity and tolerations
  • Valkey data pods may be scheduled on unintended or unsuitable nodes

This behavior can lead to issues in environments with:

  • Dedicated node pools
  • Node taints and tolerations
  • Strict workload placement requirements

Additionally, there is currently no option available in ValkeySentinel.spec.valkeyReplicationConfig to configure affinity and tolerations for ValkeyReplication pods directly through the ValkeySentinel resource.

Cause

This behavior is by design.

The Valkey Operator treats Sentinel and ValkeyReplication pods differently because:

  • Sentinel pods are lightweight and have minimal resource requirements.
  • Valkey data pods are memory-intensive and may require separate, more controlled scheduling strategies.

To avoid unintended resource contention or suboptimal scheduling, the operator does not automatically propagate affinity and tolerations from Sentinel to replication pods.

Resolution

Workaround:

Option 1: Define affinity and tolerations directly in the ValkeyReplication resource.

Option 2: Create ValkeyReplication Separately:

  1. Create a ValkeyReplication resource with the required affinity and tolerations.
  2. Reference this existing replication resource when creating the ValkeySentinel.

This approach allows full control over scheduling of Valkey data pods.

Permanent Fix:

R&D had added support for configuring affinity and tolerations under ValkeySentinel.spec.valkeyReplicationConfig v3.4.0.