liveBook · Manning

Drift

As explained in Automating API Delivery

Configuration drift is a divergence between a system's desired configuration and its actual deployed configuration.

Drift is a difference between a desired state and what is actually deployed. For API gateway configuration, the desired state is declared in an environment repository, while the actual state is the configuration running in an environment. A direct change through the gateway UI can create drift; so can an intentional repository change that has not yet reached the gateway. section 1.5.6

Continuous reconciliation turns that difference into an operational workflow:

  • Keep the desired configuration in Git. Make changes through pull requests so they can be reviewed and audited, rather than editing the gateway directly. section 1.5.6 section 9.4.1
  • Have a software agent compare the deployed configuration with the repository. When it detects drift, it can raise an alert and attempt to update the deployed state to match. section 1.5.6 section 9.4.1
  • If a repository change must be undone, revert it in Git so the recorded desired state changes too. section 1.5.6

A gateway changed outside Git

Suppose someone changes an API gateway setting in its admin UI but leaves the environment repository unchanged. The deployed setting now differs from the desired setting. A reconciling agent detects the divergence and attempts to restore the repository-defined configuration. To make the change persist, propose it through the Git workflow instead. section 1.5.6 section 9.4.1

A related form of API drift concerns behavior rather than gateway configuration: a live endpoint can disagree with its published OpenAPI definition. For example, a response may omit a field the API reference marks mandatory. Manual translation from the definition into controller code, or a code change not reflected in the definition, can cause this mismatch. Updating the OpenAPI definition when requirements change and generating a controller stub from it helps keep implementation and reference aligned; gateway reconciliation addresses a different desired-versus-deployed difference. section 6.1 section 1.5.6

Figure 1.4 APIOps is based on the GitOps approach of having the desired configuration state of the API gateway, and services are defined declaratively in an environment repository in Git. Dev teams make all changes to the desired system state via Git, and operations teams can review and approve. Software agents automatically detect any difference between the deployed state and the desired state (as defined in the environment repository). If the agent detects a drift, it automatically deploys the desired state to the specified environment so the actual state matches.
figure

Follow the path from the Git environment repository to the deployed API gateway: the agent detects a difference and deploys the desired state to close it. section 1.5.6

How Automating API Delivery covers it

How deep it goes
Explains causes, comparison, alerts, and correction of configuration drift, without specifying an agent implementation or command sequence.
Examples
Uses a direct API gateway UI change and a live API response missing a mandatory documented field.
What it assumes
Assumes familiarity with API gateways, Git repositories, and deployed environments; introduces the desired-versus-actual-state distinction.
What you can do after
Operate/configure API gateway changes through Git and use reconciliation to detect and correct deployed configuration drift.
How it connects
Connects configuration drift to GitOps, infrastructure as code, pull requests, CI/CD pipelines, and API conformance.

Also explained in

Compare how 12 books explain drift →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Automating API Delivery. The section links point to the parts of the book it draws on.