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

