Advanced application settings in a Kubernetes cluster are tools for distributing workload across nodes. You can use them to control where and how containers run, as well as customize how they interact with nodes and other replicas. With these settings, you can improve system resiliency, limit the impact of failures, and protect critical components.
Pod placement settings
To distribute pods across nodes, you can use the tools:
- topologySpreadConstraints parameter to distribute pods evenly across the cluster topology.
- nodeSelector parameter to place pods on specific nodes.
- Taints and tolerations tools to allocate nodes for critical services and prohibit other load on these nodes.
- Affinity and Anti-affinity tools to configure flexible load balancing rules on nodes.
Pod management settings
You can also apply the parameters:
- securityContext and podSecurityContext to specify security settings for containers and pods.
- podDisruptionBudget to specify the number of pods unavailable during scheduled maintenance, for example, during upgrades or migrations.
Recommendations for configuring pod placement
- For optimal configuration, use the pod placement settings consistently and test the result of their execution.
- Do not set too strict rules. This can lead to conflicts between tools.
- Avoid excessive restrictions when you set rules for taints and tolerations and use them together with the
nodeSelector
parameter. Otherwise, no suitable nodes will be found for pods. - Watch for strictness when combining the
requiredDuringSchedulingIgnoredDuringExecution
rule in Affinity with the taints ornodeSelector
parameter. In case of conflicting conditions, the placement of pods on all nodes may be blocked. - Do not allow inconsistent conditions to be set when configuring Affinity and the
topologySpreadConstraints
parameter. For example, pods cannot be started when Affinity rules require grouping pods on one node and thetopologySpreadConstraints
parameter requires distribution on different nodes.
Was this helpful?