desired state
A description of how a machine should look when the work is finished, rather than a list of steps to get there.
In more detail
Describing the finished condition, such as "this directory exists" or "three copies are running", lets a tool compare it with reality and act only on the difference. The description doubles as a record of what each system is supposed to contain.
Examples
An Ansible task that says state: directory declares an end state; a shell script that runs mkdir lists a step.In AWS: A description of how a system should look, which a tool then compares with reality and changes reality to match.In Terraform the configuration files are the desired state. Each plan compares that desired state with the recorded state and with reality, then proposes actions to close the gap. Keeping the desired state in version control is what gives a team a reviewable record of intent.Related terms
- idempotency — The property of an operation that gives the same result whether you run it once or many times, because a repeat run finds nothing left to do.
- playbook — A YAML file containing one or more plays, which together describe the state Ansible should bring a set of hosts to.
- configuration management — Keeping the software, settings, files and services on your machines in a known, described state, and putting them back when they wander from it.
- declarative description — A configuration that describes the desired operating state of a system without the procedures for reaching it.
- GitOps state store — A system for storing immutable versions of desired state declarations, with access control and auditing on changes.
- state drift — When a system's actual state has moved, or is moving, away from its desired state.
- live state — What is really running in the cluster at this moment, which may differ from the desired state.
- reconciliation — The repeated check-and-fix loop in which a program compares desired state with observed state and changes the world to match.
- GitOps — Operating a system by keeping its desired state in Git and letting a controller continuously make the live system match it.
- infrastructure as code — Describing servers, networks and other infrastructure in text files that a tool reads to create and change the real thing.
- control loop — A repeating cycle that measures something, compares it with a target and acts to close the gap.
- Kubernetes controller — A program inside or alongside the cluster that watches one kind of object and keeps acting until reality matches what that object asks for.
- playbook — The wider response plan for a whole class of incident, such as ransomware or account compromise, covering several teams.
- 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.
- spec and status — The two halves of most Kubernetes objects: spec is what you ask for, and status is what the cluster reports is actually true.
- declarative — A style where you describe the end result you want and let the tool work out the steps to get there.
- Terraform state — Terraform's record, usually a JSON file called terraform.tfstate, mapping each resource in the configuration to the real object it created.
Taught in
- What Configuration Management Is — Ansible Configuration Management at Scale
- Writing Your First Playbook — Ansible Configuration Management at Scale
- Modules And Idempotency — Ansible Configuration Management at Scale
- Check Mode And Diff — Ansible Configuration Management at Scale
- The Standard Directory Layout And Roles — Ansible Configuration Management at Scale
- Writing A Role — Ansible Configuration Management at Scale
- Testing With Molecule — Ansible Configuration Management at Scale
- A Hotfix At 3 A.M.: Who Wins At 3:05? — Certified GitOps Associate (CGOA) Exam Prep
- Half The Marks Are Definitions: How The Exam Works — Certified GitOps Associate (CGOA) Exam Prep
- Staging Is Gone: Desired State, Declarations And The State Store — Certified GitOps Associate (CGOA) Exam Prep
- Three Edits At 2 A.M.: Drift And Reconciliation — Certified GitOps Associate (CGOA) Exam Prep
- Sixteen Pods, Room For Twelve: The System, Feedback And Continuous — Certified GitOps Associate (CGOA) Exam Prep
- Two Ways Back From 2.5: Rollback The GitOps Way — Certified GitOps Associate (CGOA) Exam Prep
- Terminology Sprint: One Incident, Nine Terms — Certified GitOps Associate (CGOA) Exam Prep
- Seven Steps Called GitOps: The Declarative Principle — Certified GitOps Associate (CGOA) Exam Prep
- Someone Cleaned Up The History: Versioned And Immutable — Certified GitOps Associate (CGOA) Exam Prep
- Twelve Keys To Production: Pulled Automatically — Certified GitOps Associate (CGOA) Exam Prep
- An Hour Without Payments: Continuously Reconciled — Certified GitOps Associate (CGOA) Exam Prep
- Principles Sprint: Six Setups, One Question — Certified GitOps Associate (CGOA) Exam Prep
- Two Clicks Nobody Wrote Down: Configuration And Infrastructure As Code — Certified GitOps Associate (CGOA) Exam Prep
- What Does CI Still Do? CI, CD And Where GitOps Starts — Certified GitOps Associate (CGOA) Exam Prep
- Related Practices Sprint: One Change, Five Practices — Certified GitOps Associate (CGOA) Exam Prep
- Thursday, With A Way Back: Promotion, Deploy And Release — Certified GitOps Associate (CGOA) Exam Prep
- Friday, Four Fifty: Progressive Delivery — Certified GitOps Associate (CGOA) Exam Prep
- Three Minutes Of Waiting: Pull Versus Event-Driven — Certified GitOps Associate (CGOA) Exam Prep
- Three Regions By Spring: GitOps Architecture — Certified GitOps Associate (CGOA) Exam Prep
- Patterns Sprint: Eight Needs, One Pattern Each — Certified GitOps Associate (CGOA) Exam Prep
- Three Teams, Three Formats: Manifests And Packaging — Certified GitOps Associate (CGOA) Exam Prep
- A Bucket Nobody Wrote Down: State Stores Beyond Git — Certified GitOps Associate (CGOA) Exam Prep
- A Bake-Off With One Rule: Argo CD And Flux — Certified GitOps Associate (CGOA) Exam Prep
- A Rollback Nobody Heard: Notifications, Observability And CI — Certified GitOps Associate (CGOA) Exam Prep
- Tooling Sprint: The CTO's Shopping List — Certified GitOps Associate (CGOA) Exam Prep
- Forty-Six Of Sixty: The Mock And What It Tells You — Certified GitOps Associate (CGOA) Exam Prep
- The Evening Before: Final Review — Certified GitOps Associate (CGOA) Exam Prep
- The Push Model vs. The Pull Model — Continuous Integration & Continuous Delivery Pipelines
- What is GitOps? — Continuous Integration & Continuous Delivery Pipelines
- Drift Detection and Self-Healing — Continuous Integration & Continuous Delivery Pipelines
- The Console versus the CLI — Cloud Infrastructure & Hyperscaler Architecture
- Infrastructure as Code (Handover to Terraform) — Cloud Infrastructure & Hyperscaler Architecture
- Infrastructure As Code Context — DevOps & Site Reliability Engineering
- Containers And Orchestration Context — DevOps & Site Reliability Engineering
- Pipelines And GitOps Context — DevOps & Site Reliability Engineering
- From Docker To Desired State — Kubernetes: Production-Grade Container Orchestration
- Troubleshooting: describe, Events And A First Smoke Test — Kubernetes: Production-Grade Container Orchestration
- Deployments, ReplicaSets, Rollouts And Rollback — Kubernetes: Production-Grade Container Orchestration
- Troubleshooting: ImagePullBackOff And Failed Rollouts — Kubernetes: Production-Grade Container Orchestration
- Argo CD Applications And Flux Reconciliation — Kubernetes: Production-Grade Container Orchestration
- A Tiny CRD, Controller And The Operator Pattern — Kubernetes: Production-Grade Container Orchestration
- What Is Infrastructure As Code? — Infrastructure as Code with Terraform
- Scaling Resources With Count — Infrastructure as Code with Terraform
- What State Really Is And Why It Is Needed — Infrastructure as Code with Terraform
- Infrastructure As Code, And One Workflow For Every Platform — HashiCorp Terraform Associate (004) Exam Prep
- Graded On A Machine You Never Touched — RHCE in Ansible (EX294): Automate Red Hat Systems
- Deploying Files: file, copy, lineinfile And blockinfile — RHCE in Ansible (EX294): Automate Red Hat Systems
- RHEL System Roles: timesync And selinux From A Collection — RHCE in Ansible (EX294): Automate Red Hat Systems
- Storage: Partitions, Volume Groups And Volumes Where The Disk Exists — RHCE in Ansible (EX294): Automate Red Hat Systems
- Drill: A Web Node From A Ticket — RHCE in Ansible (EX294): Automate Red Hat Systems
- Drill: Storage Only Where The Disk Exists — RHCE in Ansible (EX294): Automate Red Hat Systems
- Mock Exam, Part 1: Seven Tasks Across Three Sections — RHCE in Ansible (EX294): Automate Red Hat Systems
- Mock Exam, Part 2: Real Machines And The Patterns That Fail — RHCE in Ansible (EX294): Automate Red Hat Systems
References
- Ansible concepts
- Intro to playbooks
- OpenGitOps Glossary v1.0.0
- OpenGitOps principles
- Kubernetes: Declarative management of objects
- Terraform: core workflow
- Kubernetes documentation: controllers
- Purpose of Terraform state
- What is Terraform?