diff --git a/xml/cap_depl_aks.xml b/xml/cap_depl_aks.xml index 1e483c68..6a713347 100644 --- a/xml/cap_depl_aks.xml +++ b/xml/cap_depl_aks.xml @@ -201,6 +201,11 @@ &ingress-controller; + + + &affinity; + + &high-availability; diff --git a/xml/cap_depl_caasp.xml b/xml/cap_depl_caasp.xml index e47f6e92..b6933aca 100644 --- a/xml/cap_depl_caasp.xml +++ b/xml/cap_depl_caasp.xml @@ -265,6 +265,11 @@ sed 's/"namespace": "default"/"namespace": "kubecf"/' | kubectl create --filenam &ingress-controller; + + + &affinity; + + &high-availability; diff --git a/xml/cap_depl_eks.xml b/xml/cap_depl_eks.xml index f124879c..3bc01315 100644 --- a/xml/cap_depl_eks.xml +++ b/xml/cap_depl_eks.xml @@ -127,6 +127,11 @@ &ingress-controller; + + + &affinity; + + &high-availability; diff --git a/xml/cap_depl_gke.xml b/xml/cap_depl_gke.xml index f5fe6ef8..ec3c2345 100644 --- a/xml/cap_depl_gke.xml +++ b/xml/cap_depl_gke.xml @@ -243,6 +243,11 @@ &ingress-controller; + + + &affinity; + + &high-availability; diff --git a/xml/repeated-content-decl.ent b/xml/repeated-content-decl.ent index f14f1305..5423ecf1 100644 --- a/xml/repeated-content-decl.ent +++ b/xml/repeated-content-decl.ent @@ -1195,6 +1195,131 @@ nginx-ingress-controller LoadBalancer 10.63.248.70 '> + + + + Affinity and Anti-affinity + + + Operators can set affinity/anti-affinity rules to restrict how the scheduler + determines the placement of a given pod on a given node. This can be + achieved through node affinity/anti-affinity, where placement is determined + by node labels (see + ), + or pod affinity/anti-affinity, where pod placement is determined by labels + on pods that are already running on the node (see + ). + + + In &productname;, a default configuration will have following + affinity/anti-affinity rules already in place: + + + + + Instance groups have anti-affinity against themselves. This applies to all + instance groups, including database, but not to the + bits, eirini, and + eirini-extensions subcharts. + + + + + The diego-cell and router instance + groups have anti-affinity against each other. + + + + + Configuring Rules + + To add or override affinity/anti-affinity settings, add a + sizing.INSTANCE_GROUP.affinity block to your + &values-filename;. Repeat as necessary for each instance group where + affinity/anti-affinity settings need to be applied. For information on + the available fields and valid values within the affinity: + block, see + . + Repeat as necessary for each instance group where affinity/anti-affinity + settings need to be applied. + + + Example 1, node affinity. + + + Using this configuration, the &kube; scheduler would place both the + asactors and asapi instance groups on a + node with a label where the key is + topology.kubernetes.io/zone and the value is + 0. + +sizing: + asactors: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: topology.kubernetes.io/zone + operator: In + values: + - 0 + asapi: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: topology.kubernetes.io/zone + operator: In + values: + - 0 + + + Example 2, pod anti-affinity. + +sizing: + api: + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: quarks.cloudfoundry.org/quarks-statefulset-name + operator: In + values: + - sample_group + topologyKey: kubernetes.io/hostname + database: + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: quarks.cloudfoundry.org/quarks-statefulset-name + operator: In + values: + - sample_group + topologyKey: kubernetes.io/hostname + + + Example 1 above uses topology.kubernetes.io/zone as its + label, which is one of the standard labels that get attached to nodes by + default. The list of standard labels can be found at + . + + + In addition to the standard labels, custom labels can be specified as in + Example 2. To use custom labels, following the process described in this + section . + + '> +