Skip to content

Commit 6445d5e

Browse files
authored
fix: affinity in IN
1 parent 5441dfa commit 6445d5e

File tree

1 file changed

+59
-4
lines changed

1 file changed

+59
-4
lines changed

docs/public/installation.md

Lines changed: 59 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -894,13 +894,68 @@ availability zones.
894894
You can manage pods' distribution using `affinity` rules to prevent Kubernetes from running ZooKeeper pods on nodes of
895895
the same availability zone.
896896

897+
#### Affinity cross Kubernetes Nodes
898+
899+
Default affinity cross kubernetes Nodes (1 pod per 1 node).
900+
901+
<details>
902+
<summary>Click to expand YAML</summary>
903+
904+
```yaml
905+
zooKeeper:
906+
affinity: {
907+
"podAntiAffinity": {
908+
"requiredDuringSchedulingIgnoredDuringExecution": [
909+
{
910+
"labelSelector": {
911+
"matchExpressions": [
912+
{
913+
"key": "component",
914+
"operator": "In",
915+
"values": [
916+
"zookeeper"
917+
]
918+
}
919+
]
920+
},
921+
"topologyKey": "kubernetes.io/hostname"
922+
}
923+
]
924+
},
925+
"nodeAffinity": {
926+
"requiredDuringSchedulingIgnoredDuringExecution": {
927+
"nodeSelectorTerms": [
928+
{
929+
"matchExpressions": [
930+
{
931+
"key": "role",
932+
"operator": "In",
933+
"values": [
934+
"compute"
935+
]
936+
}
937+
]
938+
}
939+
]
940+
}
941+
}
942+
}
943+
```
944+
945+
</details>
946+
947+
Where:
948+
949+
* `kubernetes.io/hostname` is the name of the label that defines the node name. This is the default name for Kubernetes.
950+
* `role` and `compute` are the sample name and value of label that defines the region to run ZooKeeper pods.
951+
897952
**Note**: This section describes deployment only for `storage class` Persistent Volumes (PV) type because with
898953
Predefined PV, the ZooKeeper pods are started on the nodes that are specified explicitly with Persistent Volumes. In
899954
that way, it is necessary to take care of creating PVs on nodes belonging to different AZ in advance.
900955

901956
#### Replicas Fewer Than Availability Zones
902957

903-
For cases when the number of ZooKeeper pods (value of the `zookeeper.replicas` parameter) is equal or less than the number of
958+
For cases when the number of ZooKeeper pods (value of the `zooKeeper.replicas` parameter) is equal or less than the number of
904959
availability zones, you need to restrict the start of pods to one pod per availability zone.
905960
You can also specify additional node affinity rule to start pods on allowed Kubernetes nodes.
906961

@@ -910,7 +965,7 @@ For this, you can use the following affinity rules:
910965
<summary>Click to expand YAML</summary>
911966

912967
```yaml
913-
zookeeper:
968+
zooKeeper:
914969
affinity: {
915970
"podAntiAffinity": {
916971
"requiredDuringSchedulingIgnoredDuringExecution": [
@@ -960,7 +1015,7 @@ Where:
9601015

9611016
#### Replicas More Than Availability Zones
9621017

963-
For cases when the number of ZooKeeper pods (value of the `zookeeper.replicas` parameter) is greater than the number of availability
1018+
For cases when the number of ZooKeeper pods (value of the `zooKeeper.replicas` parameter) is greater than the number of availability
9641019
zones, you need to restrict the start of pods to one pod per node and specify the preferred rule to start on different
9651020
availability zones.
9661021
You can also specify an additional node affinity rule to start the pods on allowed Kubernetes nodes.
@@ -971,7 +1026,7 @@ For this, you can use the following affinity rules:
9711026
<summary>Click to expand YAML</summary>
9721027

9731028
```yaml
974-
zookeeper:
1029+
zooKeeper:
9751030
affinity: {
9761031
"podAntiAffinity": {
9771032
"requiredDuringSchedulingIgnoredDuringExecution": [

0 commit comments

Comments
 (0)