Introduction

Deploying applications on Kubernetes is powerful, but doing it manually again and again using kubectl can become slow, error-prone, and hard to manage. Many teams face issues like missed updates, wrong configurations, and no clear history of changes.

This is where GitOps with ArgoCD helps.

In simple words, GitOps means: your Git repository becomes the main control system for your application deployment. You just push changes to Git, and ArgoCD automatically updates your Kubernetes cluster.

This approach is widely used in modern DevOps, cloud computing, and CI/CD pipelines because it is reliable, traceable, and easy to scale.

What is GitOps in Kubernetes?

GitOps is a deployment approach where your entire Kubernetes setup (applications, configs, services) is stored in a Git repository.

How GitOps works in simple words

Real-life example

Think of Git like a “remote control” for your infrastructure.

Before GitOps:
You manually press buttons (kubectl commands) every time.

After GitOps:
You just change something in Git, and everything updates automatically.

This makes Kubernetes deployment faster and safer.

What is ArgoCD?

ArgoCD is a GitOps continuous delivery (CD) tool made specifically for Kubernetes.

It watches your Git repository and ensures that your Kubernetes cluster always stays in sync with it.

Key features of ArgoCD

Simple understanding

ArgoCD = Git watcher + Kubernetes deployer

How ArgoCD GitOps Workflow Works

Let’s understand the full GitOps workflow step by step.

Step-by-step flow

Before vs After GitOps

Before using GitOps:

After using GitOps with ArgoCD:

This is why GitOps is becoming standard in DevOps.

Prerequisites for ArgoCD Kubernetes Deployment

Before starting, make sure your environment is ready.

Required tools

Beginner tip

If you are new, start with Minikube locally. It is simple and good for practice.

Step 1: Install ArgoCD in Kubernetes Cluster

First, create a separate namespace for ArgoCD.

kubectl create namespace argocd

Now install ArgoCD using official manifests:

kubectl apply -n argocd -f

What happens internally?

You can verify installation using:

kubectl get pods -n argocd

Step 2: Access ArgoCD Dashboard (UI)

To access ArgoCD UI locally:

kubectl port-forward svc/argocd-server -n argocd 8080:443

Open browser:

https://localhost:8080

Get login password

kubectl get secret argocd-initial-admin-secret -n argocd -o yaml

Decode it and login using:

Why UI is important?

Step 3: Prepare Git Repository for Kubernetes Deployment

Now create a Git repository that contains Kubernetes YAML files.

Recommended folder structure

app/
  deployment.yaml
  service.yaml

Example deployment file

apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-app
spec:
  replicas: 2
  selector:
    matchLabels:
      app: my-app
  template:
    metadata:
      labels:
        app: my-app
    spec:
      containers:
        - name: my-app
          image: nginx
          ports:
            - containerPort: 80

Simple explanation

This file tells Kubernetes how to run your application.

Step 4: Connect Git Repository to ArgoCD

Now link your Git repository with ArgoCD.

Using UI

Using CLI

argocd repo add

Why this step matters?

Without connecting Git, ArgoCD cannot read your application configuration.

Step 5: Create Application in ArgoCD

Now create an application that connects Git and Kubernetes.

argocd app create my-app \
--repo \
--path app \
--dest-server \
--dest-namespace default

What each parameter means

This step defines your deployment pipeline.

Step 6: Sync Application (Deploy to Kubernetes)

Now deploy your application:

argocd app sync my-app

What happens here?

Output

Your application will be running inside Kubernetes.

Step 7: Enable Auto-Sync (Continuous Deployment)

To automate deployment completely:

argocd app set my-app --sync-policy automated

What this does

This is the core of GitOps automation.

Step 8: Update Application (Real DevOps Example)

Let’s say you want to scale your app.

Before:

replicas: 2

After:

replicas: 3

What you do

What ArgoCD does

No kubectl command needed.

Step 9: Rollback Deployment Using ArgoCD

If deployment fails or bug appears:

Using UI

Why rollback is powerful

Advantages of ArgoCD GitOps Workflow

  1. Fully automated deployment

    No need for manual commands, everything runs automatically.

  2. Version control with Git

    Every change is tracked and reversible.

  3. Faster debugging

    You can check exactly what changed and when.

  4. Self-healing system

    If cluster state changes manually, ArgoCD fixes it.

  5. Better team collaboration

    Developers and DevOps teams work using Git workflows.

Disadvantages of ArgoCD GitOps

  1. Initial setup complexity

    Beginners may find setup confusing.

  2. Requires Git discipline

    All changes must go through Git only.

  3. Learning curve

    Understanding GitOps takes some time.

Common Mistakes to Avoid in Kubernetes GitOps

  1. Manual changes in cluster

    Avoid using kubectl directly after GitOps setup.

  2. Poor Git structure

    Keep your repo clean and organized.

  3. Not enabling auto-sync

    Without this, GitOps becomes semi-manual.

  4. Hardcoded values

    Use environment configs instead of hardcoding.

Real-World Use Case of ArgoCD GitOps

A startup was deploying apps manually using kubectl.

Problems faced

After implementing ArgoCD

This is why companies adopt GitOps.

Summary

Deploying applications on Kubernetes using ArgoCD GitOps workflow makes the entire process automated, reliable, and easy to manage. Instead of manually deploying applications, you simply push changes to Git, and ArgoCD ensures your Kubernetes cluster stays updated. This approach improves deployment speed, reduces human errors, and provides complete visibility through version control. For modern DevOps engineers and developers, learning Kubernetes GitOps with ArgoCD is an essential skill for building scalable and production-ready systems.