ArgoCD
This week I have investigated in GitOps: "What is it and how to implement it". GitOps is a set of best practices where the entire code delivery process is controlled via Git, including infrastructure and application definition as code and automation to complete updates and rollbacks. IT makes your SCM (most common is a Git server) the source of truth for everything (and not just the application source code). With GitOps you describe your whole platform (infrastructure and applications) in a declarative format and use Git for storage, history, and auditing of your deployments. GitOps agents constantly monitor the actual state, comparing against the desired state as defined in git and apply the desired state. Discarding custom deployment scripts and adopting a GitOps approach can help you avoid failed deployments, configuration drift, and fragile releases.
The Key GitOps Principles:
- The entire system (infrastructure and applications) is described declaratively.
- The canonical desired system state is versioned in Git.
- Changes approved are automated and applied to the system.
- Software agents ensure correctness and alert on divergence.
You can find a full description of GitOps principles at https://opengitops.dev/
In the case of Kubernetes, GitOps deployments happen in the following manner:
- A GitOps agent is deployed on the cluster.
- The GitOps agent is monitoring one or more Git repositories that define applications and contain Kubernetes manifests (or Helm charts or Kustomize files).
- Once a Git commit happens the GitOps agent is instructing the cluster to reach the same state as what is described in Git.
- Developers, operators. and other stakeholders perform all changes via Git operations and never directly touch the cluster (or perform manual kubectl commands).
One of those tools to use, is for example ArgoCD. ArgoCD is a platform that enables GitOps for Kubernetes deployments. It allows you to describe your applications in a declarative format, it can eliminate configuration drift, and coupled with other Argo projects, it can change the way you work with Kubernetes.
This week I followed beautifull courses located at this link which guide you through the functionality of the tool itself. Having covered the basics about GitOps with Argo CD, you will explore more advanced use cases and features of ArgoCD needed for both scale and practical implementation. Definitely worthwhile to explore!