A simple "Hello World" web application demonstrating continuous deployment with ArgoCD.
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.
- Simple Hello World web application
- Containerized with Docker
- Deployed on Kubernetes
- Continuous deployment with ArgoCD
- Automatic synchronization from Git repository
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.
.
├── 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
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
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml# 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 -dAccess the UI at https://localhost:8080 with username admin and the password from above.
# Build the image
docker build -t <your-username>/hello-world:latest ./app
# Push to registry
docker push <your-username>/hello-world:latestNote: Update the image name in k8s/deployment.yaml to match your registry path.
# Apply the ArgoCD application
kubectl apply -f argocd/application.yaml
# Check the sync status
kubectl get applications -n argocd# Get the service URL (for minikube)
minikube service hello-world --url
# Or check the service
kubectl get servicesTo verify that ArgoCD automatically deploys changes:
- Edit
app/index.htmlto change the message - Rebuild and push the Docker image with a new tag
- Update
k8s/deployment.yamlwith the new image tag - Commit and push changes to Git
- Watch ArgoCD automatically sync the changes
- Refresh your browser to see the updated message
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.
# Check ArgoCD application status
kubectl describe application hello-world -n argocd
# Check ArgoCD logs
kubectl logs -n argocd deployment/argocd-application-controller# Check pod status
kubectl get pods
# Check service
kubectl get services
# Check pod logs
kubectl logs <pod-name>- Verify the image exists in your registry
- Check image name and tag in deployment.yaml
- Ensure cluster has access to pull from the registry
- "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
MIT
This is a demonstration project. Feel free to fork and modify for your own learning purposes.