Automation · Kubernetes Automation
Declarative Resources
Cheat sheet · https://pcornel.dk/topic.php?topic=5794
Answer
Declarative resources describe the desired Kubernetes objects in YAML and apply them with kubectl apply or GitOps, letting the cluster reconcile toward that state instead of running imperative commands.
Remember
- Apply manifests with kubectl apply or GitOps.
- Server-side dry run validates against the cluster.
- kubectl diff shows changes.
First checks
kubectl apply --server-side -f manifests/— server-side applykubectl diff -f manifests/— preview- Field managers — ownership
Commands
kubectl applykubectl edit
Verify in this order
desired manifests → apply → controllers reconcile
Where it usually breaks
Configuration/input → graph/state refresh → plan → provider API request → provider terminal result → resource read-back → effective service state → workload.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5794