Automation · GitOps
Declarative Configuration
Cheat sheet · https://pcornel.dk/topic.php?topic=5484
Answer
Declarative configuration describes what the system should look like, such as Kubernetes manifests or Terraform files, rather than the steps to get there, which makes GitOps reconciliation possible.
Remember
- Declarative config describes the end state.
- It enables reconciliation by controllers.
- Examples: Kubernetes manifests, Terraform.
First checks
kubectl diff -k <path>— declarative diffkustomize build <path> | kubeconform -strict— validate manifestshelm template <chart> -f values.yaml— render Helm
Commands
git diff --check- Read-only/validation observation for whitespace/conflict-marker style errors in pending repository changes.
kubectl scale --replicas=3
Verify in this order
declarative files → render → validate
Where it usually breaks
Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5484