declarative configuration
Describing the end result you want in files and letting a tool work out the steps, rather than typing each step as a command.
In more detail
Applying the same declaration twice changes nothing the second time, because the system already matches. Imperative commands do one action right now and leave no reviewable record. Declarative files are what make code review, rollback and GitOps possible.
Examples
kubectl apply -f web-deployment.yaml # declarativekubectl delete pod web # imperativeRelated terms
- desired state — A description of how a machine should look when the work is finished, rather than a list of steps to get there.
- kubectl apply — The kubectl command that creates or updates Kubernetes objects to match the manifests you give it.
- Kubernetes manifest — A YAML or JSON file that describes one or more Kubernetes objects, ready to be sent to the cluster with kubectl apply.
- GitOps — Operating a system by keeping its desired state in Git and letting a controller continuously make the live system match it.
Taught in
- Namespaces, Labels And Declarative Manifests — Kubernetes: Production-Grade Container Orchestration
- Deployments, ReplicaSets, Rollouts And Rollback — Kubernetes: Production-Grade Container Orchestration
- NetworkPolicy And The Consul Service Mesh Boundary — Kubernetes: Production-Grade Container Orchestration