Using Argo CD to Create GitOps-Style Deployments for Kubernetes
The 2023 Veeam Data Protection Trends Report found that 92% of organizations have deployed or are planning to deploy containers. Kubernetes simplifies the work of software developers deploying into containers by automating the deployment, management and scaling of containerized applications (or microservices). By providing load balancing and simplifying container management across multiple hosts, Kubernetes delivers greater scalability, flexibility and portability for enterprise applications.
Despite these benefits, developers have struggled to deploy and update applications in Kubernetes because doing so requires manual and often complex processes. Argo, an open source tool for managing Kubernetes deployments, enables development teams to overcome these challenges, and Argo CD, in particular, offers GitOps-style deployments for Kubernetes, providing the necessary tools and framework to implement DevOps practices, such as Continuous Integration/Continuous Delivery (CI/CD) pipelines, collaboration and version control.
Argo CD
The goal of CI/CD pipelines is to improve the overall software delivery life cycle through automation. Tools like Jenkins and Spinnaker are great for establishing these CI/CD pipelines; however, when an organization needs to reconfigure an application, the DevOps team and developers must manually apply the changes to each Kubeconfig file for each cluster–a time-consuming and error-prone process. While it’s possible to write triggers to automatically initiate each pipeline using webhooks, this requires yet another complex engineering project for the developers.
Argo CD lets DevOps teams easily create and manage Kubernetes clusters. When changes are made to any Kubernetes manifest files in Git–the single source of truth–all users are automatically notified, and the affected applications are automatically synced with the new configuration in Git.
While Argo CD (and Argo as a complete toolset) supports only Kubernetes deployments, it has become a favorite tool of developers and DevOps teams because it offers powerful features that support:
- Automatic deployment into multiple Kubernetes clusters hosted on public or private clouds.
- GitOps-style deployment, enabling DevOps engineers to use Git to declare a desired state for an application or infrastructure resource and have the target application automatically synchronized with the currently declared state.
- Canary and blue-green deployment strategies so the DevOps team or a site reliability engineer (SRE) can roll back an application to its previous version in Git in case of a deployment failure in the production environment. (Requires Argo CD and Argo Rollouts)
- Single sign-on (SSO) authentication through built-in integrations for SSO providers such as OIDC, OAuth2, LDAP, SAML 2.0, GitHub, GitLab, Microsoft and LinkedIn.
- Role-based access controls (RBAC) and multitenancy to ensure least privilege access to specific Argo services and Kubernetes clusters based on a user’s role. For example, developers may be limited to a specific cluster for deploying code, while managers may have access to dashboards and reports across all clusters.
- Adapters for source code management software, such as GitLab, GitHub and BitBucket, as well as configuration management and templating tools, such as plain YAML, Helm charts, Jsonnet and Kustomize. The Argo open source community is continually enabling support for more tools in the CI/CD process
In addition to automating deployments of apps to different clusters from Git, Argo CD:
- Immediately detects changes to any YAML files, such as Deployment, Configmap, Secret, Service and Istio, and quickly initiates a sync.
- Recognizes any drift in the configuration of production systems and brings them back to the desired state as defined in Git.
- Accelerates application migration from one cluster to another by simply changing the target cluster from the Argo UI.
Getting Started With Argo and GitOps
As a lightweight, open source software for GitOps, Argo is being rapidly adopted for cloud-native applications, and Argo CD is the most popular Argo sub-project. If you’re determined to simplify and automate your software delivery life cycle by using Argo for GitOps-style deployments, you can start by consulting the following resources:
- Argo and Argo CD GitHub projects
- Argo CD manual
- Argo CD Slack channels
If you lack the internal expertise to implement Argo CD yourself, don’t give up! Argo CD is supported by a vibrant open source community, with help easily available on the project’s Slack channels. Expert advice is available from recognized Argo and CI/CD specialists to ensure you can quickly gain all the benefits from GitOps-style application deployments for Kubernetes.