RousselTMLEARNING

TP · DevOps: From Discovery to Expertise

Lab: GitOps with Argo CD

What you will learn in this TP
  • Install Argo CD
  • Declare a synced Application
  • Deploy and roll back through Git

Introduction #

What you will learn in this section
  • Install Argo CD
  • Declare a synced Application
  • Deploy and roll back through Git

Context. Kubernetes deployments are done with kubectl apply from laptops and nobody knows what is really running. You make Git the source of truth.

Prerequisites: Docker, kubectl, kind and a GitHub account (public fork of the examples repository)  ·  Estimated time: 50 min

An application whose every change goes through Git.

Hands-on #

Guided steps, with their solution.

  1. 1. Install Argo CD

    Why? Argo CD runs in the cluster and pulls state from Git: CI no longer needs cluster access.

    Create a kind cluster, install Argo CD, wait until it is ready and get the initial password.
  2. 2. Prepare the deployment repository

    Why? The deployment repository holds the manifests: that is what you change to deploy.

    Fork argoproj/argocd-example-apps on GitHub and clone your fork. The guestbook folder contains a Deployment and a Service.
  3. 3. Declare the Application

    Why? The Application object links a Git repository path to a namespace; selfHeal and prune make sync continuous.

    Create the guestbook Application with automatic sync and check pods are created.
  4. 4. See self-healing

    Why? Any manual change is drift: Argo CD corrects it to return to the state described in Git.

    Change the replica count with kubectl scale and watch Argo CD restore the Git value.
  5. 5. Deploy with a commit

    Why? Deploying means changing Git: Git reviews, history and permissions apply to releases.

    Set 3 replicas in the manifest, push, then watch the sync (force a refresh if needed).
  6. 6. Roll back through Git

    Why? Rollback is a git revert: traced, reviewed and reproducible.

    Revert the commit, push, check the return to 1 replica and view the Application history. Then delete the cluster.

Difficulty level : ●●●○○ (3/5)

My progress

  • ⏱ Estimated time : ≈ 50 min

Sign in to track your progress and take notes. Sign in

✉️ Ask a question

Recommended Articles

Infrastructure as Code et GitOps : Terraform, Ansible et Argo CD

Gérer l'infrastructure comme du code : déclaratif ou impératif, Terraform (providers, état, plan,...