Skip to content

GitOps w/ Flux

What is GitOps?πŸ“œ

  • GitOps is a set of practices built around using Git as your system’s source of truth.
  • Storing the system’s desired state in version control is crucial for implementing GitOps.
  • GitOps and Kubernetes generally go together. Your system consists of Kubernetes-based infrastructure and the applications running on top of it.
  • Defining your apps and k8s infrastructure is done declaratively using k8s manifest files.
  • You can synchronize the configuration stored in Git with the active cluster configuration using controllers.

Benefits of GitOpsπŸ“œ

  • Traceability - Knowing “who” did what.
  • Transparency - Knowing “what” is there.
  • Knowledge Sharing via Git - Allows individuals to easily understand your system using code rather than digging into the system itself. (Consider using kubectl commands instead of reading manifest files from one location.)
  • Deployments are straightforward - Commit to a branch on Git.
  • Tooling has matured to:
    • Performing state management for your cluster + resources.
    • Performing the deployment of resources to the cluster & cloud infrastructure.

GitOps FlowπŸ“œ

  1. Operator (Human/Bot) creates a branch.
  2. Operator (Human/Bot) creates a Pull Request.
  3. PR merged and approved.
  4. GitOps tool polls for changes (ArgoCD).
  5. Changes are applied to the cluster.

Git Ops Flow

Flux v2πŸ“œ

  • Flux v2 is a GitOps tool that synchronizes configuration from a Git repository into a Kubernetes cluster.
  • Ability to deploy:
    • Kustomize,
    • Helm Charts, and
    • Yaml Manifests.
  • Flux has a CLI tool for installing and interacting with Flux.

CRDs and FluxπŸ“œ

  • Flux is stateless and uses Custom Resources (CR) to store its state of functionality.
  • Custom Resource Definitions are a way to extend the functionality of Kubernetes by allowing you to create API objects and operators.
  • Allows multiple ways to interact with Flux:
    • Flux CLI,
    • Applying Kubernetes objects, and
    • Applying changes to the Git Repo.

Flux ArchitectureπŸ“œ

Git Ops Toolkit

Quiz QuestionsπŸ“œ

What is GitOps?

GitOps is a set of practices built around using Git as your system’s source of truth.

Storing the system’s desired state in version control is crucial for implementing GitOps.

GitOps and Kubernetes generally go together. Your system consists of Kubernetes-based infrastructure and the applications running on top of it.

Defining your apps and k8s infrastructure is done declaratively using k8s manifest files.

You can synchronize the configuration stored in Git with the active cluster configuration using controllers.

How does Flux v2 fit in with GitOps?

Flux v2 is a GitOps tool that synchronizes configuration from a Git repository into a Kubernetes cluster.