Configuring the HiveMQ Platform for One Pod per Kubernetes Node

This guide explains how to configure the new HiveMQ Platform to ensure that each Kubernetes node runs only one HiveMQ pod. To achieve this, you'll need to use a combination of Node Affinity and Pod Anti-Affinity in your configuration.

 Instructions

  1. Node Affinity ensures that the HiveMQ pod is scheduled only on nodes with a specific label. This guarantees that only labelled nodes are used for scheduling. You can either use existing labels or create custom labels as needed.
    Pod Anti-Affinity prevents multiple HiveMQ pods from being scheduled on the same node.

  2. The HiveMQ Platform supports this behavior through the podScheduling configuration. For more information, refer to the HiveMQ Platform Operator documentation.

  3. To configure pod scheduling in HiveMQ, add the following to your HiveMQ Platform values.yaml file

    ... # Configures how the HiveMQ platform pods should be scheduled on the Kubernetes nodes. podScheduling: # Configures the affinity for the Platform pods affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: agentpool operator: In values: - nodepool1