Automation · Kubernetes Automation
Kubernetes API
Cheat sheet · https://pcornel.dk/topic.php?topic=5792
Answer
The Kubernetes API is the REST interface every tool uses, including kubectl. Automation talks to it with client libraries or kubectl, authenticated by service accounts and controlled by RBAC.
Remember
- Everything, including kubectl, uses the API.
- Service accounts and RBAC control access.
- Use client libraries rather than raw HTTP.
First checks
kubectl api-resources— available resourceskubectl get --raw /healthz— API healthkubectl auth can-i create deployments -n <ns>— permission check
Verify in this order
client → API server → etcd → controllers
Where it usually breaks
Client payload/auth → HTTP transport → endpoint validation/policy → request accepted → queued/job execution → target mutation → effective state → consumer workload.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5792