Skip to content
This repository was archived by the owner on Oct 29, 2025. It is now read-only.

smartnews/ret-argocd-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ArgoCD Hello World Application

A simple "Hello World" web application demonstrating continuous deployment with ArgoCD.

Overview

This project showcases how to set up a basic web application with automated deployment using ArgoCD. Any changes pushed to the Git repository will automatically trigger an update to the deployed application, demonstrating GitOps principles in action.

Features

  • Simple Hello World web application
  • Containerized with Docker
  • Deployed on Kubernetes
  • Continuous deployment with ArgoCD
  • Automatic synchronization from Git repository

Architecture

Git Repository → ArgoCD → Kubernetes Cluster → Web Application

ArgoCD monitors this Git repository and automatically deploys changes to the Kubernetes cluster, ensuring the live application always matches the desired state defined in Git.

Project Structure

.
├── README.md                 # Project documentation
├── working-log.md           # Implementation progress log
├── app/                     # Application source code
│   ├── Dockerfile           # Container image definition
│   └── index.html          # Simple HTML page
├── k8s/                     # Kubernetes manifests
│   ├── deployment.yaml     # Application deployment
│   └── service.yaml        # Service configuration
└── argocd/                  # ArgoCD configuration
    └── application.yaml    # ArgoCD application manifest

Prerequisites

Before you begin, ensure you have the following installed:

  • Kubernetes cluster (minikube, kind, k3s, or cloud provider like GKE, EKS, AKS)
  • kubectl - Kubernetes command-line tool
  • Docker - For building container images
  • ArgoCD - Installed on your Kubernetes cluster
  • Container registry access - Docker Hub, GitHub Container Registry, or private registry

Quick Start

1. Install ArgoCD on your cluster

kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

2. Access ArgoCD UI

# Port forward to access the UI
kubectl port-forward svc/argocd-server -n argocd 8080:443

# Get the initial admin password
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d

Access the UI at https://localhost:8080 with username admin and the password from above.

3. Build and push the Docker image

# Build the image
docker build -t <your-username>/hello-world:latest ./app

# Push to registry
docker push <your-username>/hello-world:latest

Note: Update the image name in k8s/deployment.yaml to match your registry path.

4. Deploy with ArgoCD

# Apply the ArgoCD application
kubectl apply -f argocd/application.yaml

# Check the sync status
kubectl get applications -n argocd

5. Access the application

# Get the service URL (for minikube)
minikube service hello-world --url

# Or check the service
kubectl get services

Testing Automatic Sync

To verify that ArgoCD automatically deploys changes:

  1. Edit app/index.html to change the message
  2. Rebuild and push the Docker image with a new tag
  3. Update k8s/deployment.yaml with the new image tag
  4. Commit and push changes to Git
  5. Watch ArgoCD automatically sync the changes
  6. Refresh your browser to see the updated message

Configuration

ArgoCD Sync Policy

The application is configured with automatic sync enabled:

  • Auto-sync: Changes in Git trigger automatic deployment
  • Self-heal: ArgoCD corrects any manual changes to match Git
  • Auto-prune: Resources removed from Git are deleted from the cluster

You can modify these settings in argocd/application.yaml.

Troubleshooting

Application not syncing

# Check ArgoCD application status
kubectl describe application hello-world -n argocd

# Check ArgoCD logs
kubectl logs -n argocd deployment/argocd-application-controller

Cannot access application

# Check pod status
kubectl get pods

# Check service
kubectl get services

# Check pod logs
kubectl logs <pod-name>

Image pull errors

  • Verify the image exists in your registry
  • Check image name and tag in deployment.yaml
  • Ensure cluster has access to pull from the registry

Acceptance Criteria Status

  • "Hello World" web application deployed using ArgoCD
  • Application accessible from web browser at specified URL
  • Application configured to sync with Git repository
  • Automatic updates triggered by Git repository changes
  • Deployment process documented

Resources

License

MIT

Contributing

This is a demonstration project. Feel free to fork and modify for your own learning purposes.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors