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π£
- Operator (Human/Bot) creates a branch.
- Operator (Human/Bot) creates a Pull Request.
- PR merged and approved.
- GitOps tool polls for changes (ArgoCD).
- Changes are applied to the cluster.
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π£
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.