1. Optimizing API Server
| Flag | Use |
--max-requests-inflight | Concurrent non-mutating (default 400) |
--max-mutating-requests-inflight | Mutating (default 200) |
--watch-cache-sizes | Per-resource watch cache |
--enable-priority-and-fairness | APF (default on) |
| Recommendation | Detail |
| Storage | NVMe SSD, dedicated disk |
| DB size | ≤ 8 GiB (compact + defrag) |
| Network | < 10ms RTT between members |
| Compaction | --auto-compaction-retention=8h |
3. Optimizing Node Resources
| Setting | Use |
| kubeReserved / systemReserved | Reserve for daemons |
| evictionHard | Memory/disk thresholds |
| cpuManagerPolicy: static | Pin Guaranteed pods to cores |
| topologyManagerPolicy: single-numa-node | NUMA alignment for low-latency |
4. Configuring DNS Optimization
# CoreDNS Corefile
.:53 {
errors
health { lameduck 5s }
ready
kubernetes cluster.local in-addr.arpa ip6.arpa { pods insecure }
prometheus :9153
forward . /etc/resolv.conf { max_concurrent 1000 }
cache 30
loop
reload
}
5. Using Node Local DNS Cache
kubectl apply -f https://raw.githubusercontent.com/kubernetes/kubernetes/master/cluster/addons/dns/nodelocaldns/nodelocaldns.yaml
Note: NodeLocalDNS reduces DNS latency and avoids conntrack races for UDP.
6. Reducing Image Pull Time
| Technique | Detail |
| Pull policy | IfNotPresent for stable tags |
| Pre-pull | DaemonSet warming images |
| Registry mirror | In-region cache |
| Lazy pull | stargz/eStargz snapshotter |
| imagePullSecrets | Authenticated mirror |
7. Optimizing Pod Startup
| Lever | Detail |
| Small base images | distroless, alpine |
| Startup probe | Avoid premature liveness kills |
| InitialDelaySeconds | Tune to match app warm-up |
| Init containers | Minimize work, cache results |
8. Using Pod Priority
See §30.10 — assign higher PriorityClass to critical workloads to ensure scheduling and preemption rights.
9. Right-Sizing Resources
| Tool | Use |
| VPA (recommend mode) | Suggested requests/limits |
| Goldilocks | VPA dashboard |
| KRR (Robusta) | Prometheus-based recommendations |
| Metric | Watch |
apiserver_request_duration_seconds | API p99 latency |
etcd_disk_backend_commit_duration_seconds | etcd write latency |
scheduler_e2e_scheduling_duration_seconds | Scheduler latency |
node_load1 | Node pressure |