0
0
Kubernetesdevops~30 mins

GitOps with ArgoCD in Kubernetes - Mini Project: Build & Apply

Choose your learning style9 modes available
GitOps with ArgoCD
📖 Scenario: You are working as a DevOps engineer for a small company. Your team wants to use GitOps to manage Kubernetes applications. You will use ArgoCD to automatically deploy an application from a Git repository to a Kubernetes cluster.
🎯 Goal: Learn how to set up a basic ArgoCD Application resource that points to a Git repository and deploys an app to Kubernetes automatically.
📋 What You'll Learn
Create a Kubernetes namespace for ArgoCD
Create an ArgoCD Application resource with correct Git repo URL and path
Set the target cluster and namespace for deployment
Verify the application sync status with ArgoCD
💡 Why This Matters
🌍 Real World
GitOps with ArgoCD is used in real companies to automate Kubernetes app deployments from Git repositories, making deployments reliable and repeatable.
💼 Career
Knowing how to use ArgoCD for GitOps is a valuable skill for DevOps engineers and site reliability engineers working with Kubernetes.
Progress0 / 4 steps
1
Create the ArgoCD namespace
Create a Kubernetes namespace called argocd using the command kubectl create namespace argocd.
Kubernetes
Need a hint?

Use kubectl create namespace argocd to create the namespace.

2
Define the ArgoCD Application manifest
Create a YAML manifest file called app.yaml that defines an ArgoCD Application resource with these exact values: apiVersion: argoproj.io/v1alpha1, kind: Application, metadata.name: guestbook, spec.source.repoURL: https://github.com/argoproj/argocd-example-apps.git, spec.source.path: guestbook, spec.destination.server: https://kubernetes.default.svc, and spec.destination.namespace: default.
Kubernetes
Need a hint?

Make sure to include metadata.name as guestbook and set the spec.source.repoURL and spec.source.path exactly as given.

3
Apply the ArgoCD Application manifest
Use the command kubectl apply -f app.yaml -n argocd to create the ArgoCD Application resource in the argocd namespace.
Kubernetes
Need a hint?

Use kubectl apply -f app.yaml -n argocd to create the Application resource.

4
Check the ArgoCD Application sync status
Run the command kubectl get applications -n argocd guestbook -o jsonpath='{.status.sync.status}' to display the sync status of the guestbook application.
Kubernetes
Need a hint?

The output should be Synced when the application is deployed successfully.