liveBook · Manning

GitOps operator

As explained in Kubernetes for Developers

A GitOps operator is a cluster-resident control loop that reconciles running resources with declarative configuration stored in a version-controlled repository.

A GitOps operator is a control loop running in a Kubernetes cluster. It continually reconciles the resources running in the cluster with the declarative configuration stored in a version-controlled repository. This keeps the live environment aligned with the reviewed configuration rather than depending on a person to apply changes. section 11.3.2 section 11.3

A GitOps operator changes deployment behavior in several practical ways:

  • It applies repository configuration after changes are committed and pushed. section 11.5
  • It continues checking for divergence after the initial change, unlike an event-driven pipeline that depends on a Git push to trigger deployment. section 11.3.2
  • It supports a workflow in which changes are made to configuration, reviewed and committed, instead of being made directly to the live cluster. section 11.5

Flux continuously reconciles a cluster

Flux is an example of a GitOps operator. A repository push can initiate deployment, but the operator also performs additional reconciliation whenever the cluster and repository configuration diverge. section 11.3.2

Listing 11.3 Chapter11/11.3.2_CloudBuild/cloudbuild-deploy.yaml
steps:
- name: 'gcr.io/cloud-builders/kubectl'
 id: Deploy
 args:
 - 'apply'
 - '-f'
 - '$FOLDER'
 env:
 - 'CLOUDSDK_COMPUTE_REGION=us-west1'
 - 'CLOUDSDK_CONTAINER_CLUSTER=my-cluster'

The Cloud Build deployment listing shows the event-driven alternative: a repository trigger runs kubectl apply against the configured cluster. section 11.3.2

How Kubernetes for Developers covers it

How deep it goes
Defines the control loop and contrasts it with event-driven deployment, but does not detail operator installation or configuration.
Examples
Uses Flux as an operator example and Cloud Build with kubectl apply as the contrasting pipeline approach.
What it assumes
Assumes Kubernetes resources, declarative configuration, repositories, and deployment pipelines; does not establish these concepts from zero.
What you can do after
Evaluate continuous reconciliation as a way to keep a Kubernetes cluster aligned with repository configuration.
How it connects
Connects GitOps operators with Kubernetes, configuration as code, version control, deployment pipelines, and continuous delivery.

Also explained in

Compare how 2 books explain GitOps operator →

Related concepts

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