This project demonstrates a complete end-to-end DevOps pipeline for a Golang-based web application, covering containerization, CI/CD automation, GitOps, and production-grade deployment using industry-standard tools. It provides a foundation for cloud-native applications with Kubernetes and microservices architecture.
The web application itself is a simple website built with Go's net/http package that serves static HTML pages.
- Simple web server with multiple pages (Home, Courses, About, Contact)
- Static content serving
- Lightweight and fast Go-based implementation
- Multi-Stage Docker Build:
- Efficient containerization using a lightweight multi-stage Dockerfile
- Build stage using official
golangimage - Runtime stage using minimal
distroless/baseimage - Optimization for image size and security
- Clear separation of build and runtime layers
- Base Manifests:
- Deployment configuration with replicas and resource limits
- Service definition for internal networking
- ConfigMaps for environment-specific settings
- Environment-agnostic templates for reusability
- Custom Helm Charts:
- Environment-specific values (Dev, QA, Production)
- Parameterized templates for consistent deployments
- Release management with versioning
- Values overriding for environment customization
- Automated Workflow:
- Triggered on every Git push
- Parallel testing and linting
- Docker image building with caching
- Vulnerability scanning
- Publishing to Docker Hub or Amazon ECR
- Status notifications
- Declarative Delivery:
- Git repository as single source of truth
- ArgoCD syncing changes from Git to the cluster
- Automatic or manual promotion between environments
- Rollback capabilities
- Drift detection
- Amazon EKS Configuration:
- Managed Kubernetes with Fargate profiles
- Required node groups and IAM roles
- Proper network configuration
- Security groups and policies
- kubectl, eksctl, and Helm setup for access
- NGINX Ingress Controller:
- External access management
- Path-based routing configured
- TLS/HTTPS termination
- Rate limiting and access control
- Domain Configuration:
- Custom domain exposure
- Integration with AWS Route53
- ExternalDNS for automatic DNS records
- Load balancer configuration
| Category | Tools Used |
|---|---|
| Language | Golang |
| Containerization | Docker (Multi-stage build) |
| Orchestration | Kubernetes (EKS) |
| Package Management | Helm |
| CI/CD | GitHub Actions, ArgoCD |
| GitOps | ArgoCD (Declarative delivery) |
| Cluster Provisioning | Amazon EKS, eksctl, kubectl |
| Ingress | NGINX Ingress Controller |
| Domain Management | AWS Route53, ExternalDNS |
| Version Control | Git + GitHub |
- Fully Automated Pipeline: Complete CI/CD pipeline from code push to production deployment
- Environment Management: Environment-specific configurations and scalable Helm-based releases
- Modern Workflow: GitOps approach aligned with current industry best practices
- Scalability: Foundation for microservices architecture with proper networking and service discovery
- Security: Reduced attack surface with distroless containers and proper network policies
- Maintainability: Declarative configurations with infrastructure as code principles
- Go 1.18 or higher
- Docker and Docker Compose
- kubectl and Helm
- AWS CLI and eksctl (for EKS deployment)
- ArgoCD CLI (optional)
-
Clone the repository:
git clone https://github.com/yourusername/go-web-app-devops.git cd go-web-app-devops -
Run the application locally:
go run main.go
-
Access the application at:
# Build the Docker image
docker build -t go-web-app:latest .
# Run the container
docker run -p 8080:8080 go-web-app:latest
# Access the application at http://localhost:8080/courses# Apply the Kubernetes manifests
kubectl apply -f k8s/manifests/
# Verify the deployment
kubectl get pods
kubectl get svc# Install using Helm
helm install go-web-app ./helm/go-web-app-chart
# Upgrade an existing release
helm upgrade go-web-app ./helm/go-web-app-chart --values ./helm/go-web-app-chart/values.yamlFollow the detailed instructions in the eks/ directory:
- Prerequisites:
eks/01-prereq.md - Cluster Setup:
eks/02-install-eks-fargate.md
Follow the GitOps setup guide in gitops/argocd/01-install.md
.
βββ Dockerfile # Multi-stage Docker build
βββ go.mod # Go module dependencies
βββ main.go # Main application code
βββ main_test.go # Unit tests
βββ eks/ # EKS cluster setup documents
βββ gitops/ # GitOps configuration (ArgoCD)
βββ helm/ # Helm charts for the application
β βββ go-web-app-chart/
β βββ Chart.yaml
β βββ values.yaml # Default values
β βββ templates/ # Kubernetes template manifests
βββ ingress-controller/ # Ingress controller setup
βββ k8s/ # Raw Kubernetes manifests
β βββ manifests/
βββ static/ # Static web content
βββ home.html
βββ courses.html
βββ about.html
βββ contact.html
βββ images/
Run unit tests:
go test ./...This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.


