The article addresses the misconception that Kubernetes inherently provides high availability. Kubernetes' scheduler, by default, prioritizes resource allocation over resilience, potentially placing all pod replicas in the same availability zone. This can lead to service outages if that zone fails. The article then outlines several tools to control pod scheduling and enhance resilience. These include `nodeSelector`, `nodeAffinity`, `podAntiAffinity`, `taints` and `tolerations`, and `TopologySpreadConstraints` to ensure proper pod distribution across zones and nodes. `nodeSelector` is simple but limited, while `nodeAffinity` offers more flexibility with preferred and required placement. `podAntiAffinity` prevents multiple replicas from residing on the same node or zone. `taints` and `tolerations` are used to reserve specific nodes for particular workloads. `TopologySpreadConstraints` ensures uniform distribution across zones. Finally, it mentions `Topology Aware Routing` as an experimental technology for optimizing network traffic within a cluster.
dev.to
dev.to
Create attached notes ...
