DEV Community

Cover image for ✅ Task #2 — Deploy Your First GitOps Application on GKE Cluster Using ArgoCD
Latchu@DevOps
Latchu@DevOps

Posted on

✅ Task #2 — Deploy Your First GitOps Application on GKE Cluster Using ArgoCD

In this task you will:

  1. Create a simple Kubernetes manifest
  2. Push it to a GitHub repo
  3. Connect ArgoCD to that repo
  4. Deploy your app automatically
  5. Test GitOps Sync (manual + auto)

⭐ STEP 1 — Create a GitHub Repo

Create a new GitHub repo:

argocd-demo-app
Enter fullscreen mode Exit fullscreen mode

Add this structure:

argocd-demo-app/
 └── deployment.yaml
 └── service.yaml
Enter fullscreen mode Exit fullscreen mode

⭐ STEP 2 — Add a Simple NGINX App

deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: demo-app
  labels:
    app: demo-app
spec:
  replicas: 2
  selector:
    matchLabels:
      app: demo-app
  template:
    metadata:
      labels:
        app: demo-app
    spec:
      containers:
        - name: nginx
          image: nginx:1.27
          ports:
            - containerPort: 80
Enter fullscreen mode Exit fullscreen mode

service.yaml

apiVersion: v1
kind: Service
metadata:
  name: demo-app
spec:
  type: LoadBalancer
  selector:
    app: demo-app
  ports:
    - port: 80
      targetPort: 80
Enter fullscreen mode Exit fullscreen mode

Push to GitHub:

git add .
git commit -m "first argocd app"
git push origin main
Enter fullscreen mode Exit fullscreen mode

1


⭐ STEP 3 — Create ArgoCD Application

🎨 Create application using UI (Beginner-friendly)

  • Open ArgoCD UI
  • Click NEW APP
  • Fill:
| Field               | Value            |
| ------------------- | ---------------- |
| Application Name    | `demo-app`       |
| Project             | default          |
| Sync Policy         | Manual (for now) |
| Repository URL      | Your GitHub repo |
| Revision            | main             |
| Path                | `.`              |
| Destination Cluster | in-cluster       |
| Namespace           | default          |
Enter fullscreen mode Exit fullscreen mode
  • Click create

2


⭐ STEP 4 — Sync Application

In UI:

👉 Select demo-app
👉 Click SYNC → SYNCHRONIZE

ArgoCD will:

  • Pull manifests from GitHub
  • Deploy them into your GKE cluster
  • Show pods, services, health status graphically

Check app in cluster:

kubectl get pods
kubectl get svc demo-app
Enter fullscreen mode Exit fullscreen mode

Wait for service external IP:

kubectl get svc demo-app -w
Enter fullscreen mode Exit fullscreen mode

Open in browser:

http://<EXTERNAL-IP>
Enter fullscreen mode Exit fullscreen mode

You will see default NGINX page.

3


⭐ STEP 5 — Test GitOps (VERY IMPORTANT)

Now edit repo:

Edit deployment.yaml:

Change image:

image: nginx:1.27 -> nginx:1.26
Enter fullscreen mode Exit fullscreen mode

Push:

git commit -am "downgrade image"
git push
Enter fullscreen mode Exit fullscreen mode

In ArgoCD:

You will see the app becomes OutOfSync

Click SYNC

ArgoCD will deploy the new version

4

If you check with ArgoCD,

5

🎉 This is GitOps!


🌟 Thanks for reading! If this post added value, a like ❤️, follow, or share would encourage me to keep creating more content.


— Latchu | Senior DevOps & Cloud Engineer

☁️ AWS | GCP | ☸️ Kubernetes | 🔐 Security | ⚡ Automation
📌 Sharing hands-on guides, best practices & real-world cloud solutions

Top comments (0)