A containerized Go web application deployed to Amazon EKS with automated CI/CD using Jenkins.
Public URL: http://api.rinando.my.id
GitHub → Jenkins → AWS ECR → Amazon EKS → ALB → Public Internet
- REST API: JSON endpoints with health checks
- Containerized: Docker-based deployment
- Auto-scaling: 3 replicas with resource limits
- CI/CD: Automated Jenkins pipeline
- Custom Domain: ALB ingress with SSL
- Monitoring: Built-in health and readiness probes
| Endpoint | Description | Example Response |
|---|---|---|
/ |
HTML landing page | Web interface |
/api/hello |
JSON API | {"message": "Hello from Go!", "host": "pod-123"} |
/health |
Health check | {"status": "healthy"} |
/ready |
Readiness probe | {"status": "ready"} |
Prerequisites: Go 1.19+
# Clone and run
git clone <repo-url>
cd <repo-name>
go mod download # Install dependencies from go.mod
go run main.go
# Access locally
open http://localhost:8080# Build image
docker build -t cfx-test-go .
# Run container
docker run -p 8080:8080 cfx-test-goCurrent Setup:
- Deployment:
go-web-app(3 replicas) - Service:
go-web-app-service(ClusterIP) - Ingress: ALB with domain
api.rinando.my.id - Resources: 128Mi memory, 100m CPU per pod
Files:
k8s/deployment.yml- Deployment + Servicek8s/ingress.yml- ALB ingress configuration
Automatic deployment on git push:
- Build: Docker image creation
- Push: Upload to AWS ECR
- Deploy: Rolling update to EKS cluster
Environment:
- ECR Repository:
cfx-test-go - EKS Cluster:
test-project-eks-cluster - AWS Region:
us-east-1
Deploy manually:
# Build and push
docker build -t cfx-test-go .
docker tag cfx-test-go 112113402575.dkr.ecr.us-east-1.amazonaws.com/cfx-test-go:latest
docker push 112113402575.dkr.ecr.us-east-1.amazonaws.com/cfx-test-go:latest
# Update deployment
kubectl set image deployment/go-web-app go-web-app=112113402575.dkr.ecr.us-east-1.amazonaws.com/cfx-test-go:latestCheck status:
# View pods
kubectl get pods -l app=go-web-app
# Check logs
kubectl logs -l app=go-web-app
# Test locally
kubectl port-forward svc/go-web-app-service 8080:80Health checks configured:
- Liveness:
/healthevery 10s - Readiness:
/readyevery 5s - ALB Health:
/healthevery 30s
Resource limits:
- Memory: 64Mi request, 128Mi limit
- CPU: 50m request, 100m limit
Common issues:
# Pod not starting
kubectl describe pod <pod-name>
# Service not accessible
kubectl get svc go-web-app-service
kubectl describe ingress multi-app-ingress
# Check ALB status
kubectl get ingress -o widePipeline fails:
- Check AWS credentials in Jenkins
- Verify ECR repository exists
- Ensure EKS cluster is accessible
├── main.go # Go application
├── go.mod # Go module dependencies
├── go.sum # Dependency checksums
├── Dockerfile # Container configuration
├── Jenkinsfile # CI/CD pipeline
├── k8s/
│ ├── deployment.yml # Kubernetes deployment + service
│ └── ingress.yml # ALB ingress configuration
└── README.md # This file
- Fork repository
- Make changes
- Test locally:
go run main.go - Push to trigger Jenkins pipeline
- Check deployment at http://api.rinando.my.id
