GitOps & ArgoCD Overview
What is GitOps?
GitOps in short is a set of practices to use Git pull requests to manage infrastructure and application configurations. Git repository in GitOps is considered the only source of truth and contains the entire state of the system so that the trail of changes to the system state are visible and auditable.
- Traceability of changes in GitOps is no novelty in itself as this approach is almost universally employed for the application source code. However GitOps advocates applying the same principles (reviews, pull requests, tagging, etc) to infrastructure and application configuration so that teams can benefit from the same assurance as they do for the application source code.
- Although there is no precise definition or agreed upon set of rules, the following principles are an approximation of what constitutes a GitOps practice:
- Declarative description of the system is stored in Git (configs, monitoring, etc)
- Changes to the state are made via pull requests
- Git push reconciled with the state of the running system with the state in the Git repository
CI/CD integration
For the full end-to-end build and delivery process, both the CI and CD pipelines are required. For this to work, a Git repo is used to convey the configuration values. Within the
, we have used certain naming conventions to streamline and simplify the untegration between the various components.The naming components are:
app repo
- The name of the Git repository for the applicationgit org
- The name of the GitHub organization for the application’s repotag
- The build versionchart version
- The version of the Helm chartregion
- The geographic location in IBM Cloud
The derived names are:
- GitHub application path:
github.com/{git org}/{app repo}
- CI Pipeline name:
{git org}.{app repo}
- Docker image’s path:
{region}.icr.io/{git org}/{app repo}:{tag}
in the Image Registry - Helm chart’s path:
generic-local/{git org}/{app repo}-{tag}-{chart version}.tgz
in the Helm Repository - Dependencies filename:
{app repo}/requirements.yaml
in the GitOps repo - CD Pipeline name:
{app repo}
Resources
- Presentation: Understanding GitOps
What is Argo CD
Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes. The deployment environment is a Kubernetes cluster or namespace, which also works for an OpenShift cluster or project. Argo CD models a collection of applications as a project and uses a Git repository to store the project’s desired state. Each application is stored as a folder in the repository, and each deployment environment is stored as a branch in the repository.
Argo CD supports defining Kubernetes manifests in a number of ways:
- helm charts
- kustomize
- ksonnet
- jsonnet
- plain directory of yaml/json manifests
Argo CD synchronizes the application state with the desired state defined in Git and automates the deployment of Kubernetes resources to ensure they match.
Activities
These activites give you a chance to walkthrough building CD pipelines using ArgoCD.
These tasks assume that you have:
- Reviewed the Continuous Deployment concept page.
Task | Description | Link | Time |
---|---|---|---|
Walkthroughs | |||
GitOps | Introduction to GitOps with OpenShift | Learn OpenShift | 20 min |
GitOps Multi-cluster | Multi-cluster GitOps with OpenShift | Learn OpenShift | 20 min |
Try It Yourself | |||
ArgoCD Lab | Learn how to setup ArgoCD and Deploy Application | ArgoCD | 30 min |
Once you have completed these tasks, you will have created an ArgoCD deployment and have an understanding of Continuous Deployment.