HarshadRanganathan/harshadranganathan.github.io

k8s traffic management

Opened this issue · 12 comments

External Traffic Policy

https://www.asykim.com/blog/deep-dive-into-kubernetes-external-traffic-policies

Local

Dedicated LB -> Health Check + Pod Anti-Affinity (prevent uneven load spread)
Shared LB -> Pod in every node

Pods

https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/

Inter-pod

https://pumpingco.de/blog/optimizing-network-traffic-across-availability-zones-in-kubernetes/

Pod disruption budget

https://itnext.io/kubernetes-draining-nodes-properly-79e18dca4d5e

Pod Anti Affinity

https://community.pivotal.io/s/article/how-do-I-evenly-distribute-my-pods-across-a-topology-without-using-pod-anti-affinity?language=en_US

Topology Spread

https://awstip.com/kubernetes-and-resilience-pod-topology-spread-constraints-1bf46205a3e1
https://medium.com/wise-engineering/avoiding-kubernetes-pod-topology-spread-constraint-pitfalls-d369bb04689e
https://awstip.com/kubernetes-and-resilience-pod-topology-spread-constraints-1bf46205a3e1

Node Placement

https://itnext.io/kubernetes-pods-and-workernodes-control-the-placement-of-the-pods-on-the-nodes-359bc958a202

Istio

Istio Deployment

https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/

istio/istio#38558

Apps

https://istio.io/latest/docs/tasks/traffic-management/locality-load-balancing/failover/

https://aws.amazon.com/blogs/containers/addressing-latency-and-data-transfer-costs-on-eks-using-istio/

General

https://medium.com/expedia-group-tech/request-load-distribution-in-kubernetes-and-aws-e139a3fec4ba

HTTP connection drains
kube-proxy load balancing strategies

Cluster communication

ClusterIP Service
Short-lived TCP (HTTP/1) vs Long-lived TCP (HTTP/2, gRPC) connections

Long-lived -> handle client side through code (load balancing, config, keep-alive etc.) or service mesh
Short-lived -> kube-proxy, ip tables (round robin - not exactly, probabilistic distribution) - for burst traffic will be uneven, for constant load traffic load balanced eventually)

High availability

Pod Anti-Affinity
Topology spreads
https://github.com/kubernetes-sigs/descheduler/blob/master/docs/user-guide.md