Filters
How to search
  • Plain words find names, texts and examples.
  • "two words" finds the exact phrase.
  • --name or -x finds an option.
  • #word looks only inside commands.
  • @grep finds lessons and labs that use grep.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Put ! before a word to leave it out. OR between words means one of them.
  • ↑ ↓ to move · Enter to open · Esc to close · / to search

Chapter 1Name in the course: GitOps principles

Understand GitOps

GitOps means: the wanted state of the cluster lives in Git, and an agent inside the cluster pulls it and keeps the cluster equal to it. Nobody runs kubectl apply against production by hand; every change is a commit, reviewed in a pull request.

  • 4 Lessons
  • 1 Commands

$ run as a normal user# run as root (or with sudo)

1.1

Know the four principles

The OpenGitOps project defines GitOps in four rules.

PrincipleMeaning
DeclarativeThe whole system is described as wanted state (YAML, Helm, Kustomize)
Versioned and immutableThat state is stored in Git, with full history
Pulled automaticallyAn agent pulls the state from Git; no push from outside
Continuously reconciledThe agent checks again and again, and fixes drift

1.2

Compare push and pull deployments

Classic CI/CD pushes into the cluster from outside. GitOps pulls from inside.

Push (CI runs kubectl/helm)Pull (GitOps agent)
Cluster credentialsStored in CIStay in the cluster
Drift (manual changes)Not noticedFound and fixed
Audit trailCI logsGit history = every change
RollbackRe-run an old pipelinegit revert

Remember

In GitOps, CI still builds and tests the image; it only updates the image tag in the config repository. The agent does the deployment.

Commands in this lesson

1.3

Know the main tools

Two CNCF graduated projects lead GitOps on Kubernetes.

ToolStrengths
Argo CDWeb UI, Application objects, app-of-apps, ApplicationSets, SSO and RBAC
FluxSmall, CLI-first, Kustomize and Helm controllers, image automation

Both reconcile Git (or OCI artifacts, Helm repositories) into clusters. Pick one per platform.

1.4

See the benefits for security

GitOps is also a security control.

  • No admin credentials in CI or on laptops — fewer keys to steal.
  • Every change is reviewed (branch protection) and signed (signed commits).
  • Drift is reverted: a manual "quick fix" or an attacker's change does not survive.
  • Disaster recovery: point a new cluster at the repository, and it rebuilds itself.

All commands in this chapter