Interview Prep/Kubernetes/Control plane, RBAC, webhooks and autoscaling

API calls are slow and the API server logs show `etcdserver: request timed out` and etcd logs show `apply request took too long` and `slow fdatasync`.

AdvancedTroubleshootingControl plane, RBAC, webhooks and autoscaling
Answer

Likely causes → etcd disk latency is too high: shared or burst-credit disks, noisy neighbours, or a large database (too many objects, huge Events, big Secrets). etcd needs fsync latency under ~10 ms.

Diagnose →

ETCDCTL_API=3 etcdctl --endpoints=https://127.0.0.1:2379 \
  --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key \
  endpoint status --write-out=table
# Prometheus
histogram_quantile(0.99, rate(etcd_disk_wal_fsync_duration_seconds_bucket[5m]))
histogram_quantile(0.99, rate(etcd_disk_backend_commit_duration_seconds_bucket[5m]))

Fix → Move etcd to dedicated low-latency SSD (provisioned IOPS / local NVMe), reduce object churn (event TTL, delete stale objects), defragment if the DB is fragmented.

Prevent → Dedicated etcd disks, alerts on WAL fsync p99 > 10 ms and DB size, and regular defrag in maintenance windows.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Control plane, RBAC, webhooks and autoscaling