Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 12. Guaranteeing Availability with Anti-Affinity
Kubernetes includes anti-affinity capabilities that protect workloads from single points of failure.
12.1. Anti-Affinity Strategies Link kopierenLink in die Zwischenablage kopiert!
Each Data Grid node in a cluster runs in a pod that runs on an OpenShift node in a cluster. Each Red Hat OpenShift node runs on a physical host system. Anti-affinity works by distributing Data Grid nodes across OpenShift nodes, ensuring that your Data Grid clusters remain available even if hardware failures occur.
Data Grid Operator offers two anti-affinity strategies:
kubernetes.io/hostname- Data Grid replica pods are scheduled on different OpenShift nodes.
topology.kubernetes.io/zone- Data Grid replica pods are scheduled across multiple zones.
Fault tolerance
Anti-affinity strategies guarantee cluster availability in different ways.
The equations in the following section apply only if the number of OpenShift nodes or zones is greater than the number of Data Grid nodes.
Scheduling pods on different OpenShift nodes
Provides tolerance of x node failures for the following types of cache:
-
Replicated:
x = spec.replicas - 1 -
Distributed:
x = num_owners - 1
Scheduling pods across multiple zones
Provides tolerance of x zone failures when x zones exist for the following types of cache:
-
Replicated:
x = spec.replicas - 1 -
Distributed:
x = num_owners - 1
spec.replicas- Defines the number of pods in each Data Grid cluster.
num_owners- Is the cache configuration attribute that defines the number of replicas for each entry in the cache.
12.2. Configuring Anti-Affinity Link kopierenLink in die Zwischenablage kopiert!
Specify where OpenShift schedules pods for your Data Grid clusters to ensure availability.
Procedure
-
Add the
spec.affinityblock to yourInfinispanCR. - Configure anti-affinity strategies as necessary.
-
Apply your
InfinispanCR.
12.3. Anti-Affinity Strategy Configurations Link kopierenLink in die Zwischenablage kopiert!
Configure anti-affinity strategies in your Infinispan CR to control where OpenShift schedules Data Grid replica pods.
Schedule pods on different OpenShift nodes
The following is the anti-affinity strategy that Data Grid Operator uses if you do not configure the spec.affinity field in your Infinispan CR:
Requiring different nodes
- 1
- OpenShift does not schedule Data Grid pods if there are no different nodes available.
To ensure that you can schedule Data Grid replica pods on different OpenShift nodes, the number of OpenShift nodes available must be greater than the value of spec.replicas.
Schedule pods across multiple OpenShift zones
The following example prefers multiple zones when scheduling pods:
Requiring multiple zones
- 1
- Uses the zone strategy only when scheduling Data Grid replica pods.