This project sets up a scalable, observable, and fully automated e-commerce web application using the following DevOps stack:
- Terraform for infrastructure provisioning on AWS
- Ansible for server configuration
- GitLab CI/CD for continuous integration and deployment
- Kubernetes for container orchestration
- Prometheus & Grafana for monitoring and alerting
xyz-ecommerce/
├── terraform/ # Infrastructure as Code (IaC)
│ ├── main.tf
│ ├── variables.tf
│ └── outputs.tf
│
├── ansible/ # Configuration management
│ ├── playbook.yml
│ └── inventory
│
├── ci-cd/ # GitLab CI/CD pipeline
│ └── .gitlab-ci.yml
│
├── monitoring/ # Monitoring configuration
│ ├── prometheus.yml
│ ├── grafana_dashboard.json
│ └── alert-rules.yml
│
├── deployment/ # Kubernetes deployment manifests
│ ├── deployment.yaml
│ ├── service.yaml
│ └── ingress.yaml
│
├── scripts/ # Automation scripts
│ ├── setup.sh
│ └── cleanup.sh
│
├── docs/ # Project documentation
│ ├── architecture.md
│ ├── installation.md
│ └── troubleshooting.md
│
└── README.mdcd terraform
terraform init
terraform apply -auto-approvecd ../ansible
ansible-playbook -i inventory playbook.ymlkubectl apply -f deployment/deployment.yaml
kubectl apply -f deployment/service.yaml
kubectl apply -f deployment/ingress.yaml# Prometheus and Grafana deployed as part of Kubernetes manifests or Helm chart
kubectl apply -f monitoring/prometheus.yml
kubectl apply -f monitoring/alert-rules.ymlEnsure .gitlab-ci.yml is pushed to your GitLab repo to trigger the automated pipeline on commit.
cd scripts
./cleanup.shhelm install my-ecommerce ./ecommerce-chart
helm upgrade my-ecommerce ./ecommerce-chart
helm uninstall my-ecommerce
---
## Configuration
Edit values.yaml to customize the deployment including image, replicas, service type, ingress, and resources.
---
### 8. Packaging and testing
```bash
# Package the chart
helm package ./ecommerce-chart
# Install in a test namespace
kubectl create namespace test-ecommerce
helm install test-release ./ecommerce-chart-1.0.0.tgz -n test-ecommerce
# Check status
kubectl get all -n test-ecommerce
# Test ingress (ensure your ingress controller is running and DNS is configured)
# Uninstall when done
helm uninstall test-release -n test-ecommerce
kubectl delete namespace test-ecommerce
## Technologies Used
- AWS (EC2, VPC, RDS, S3)
- Terraform
- Ansible
- Kubernetes (EKS or local Minikube)
- Prometheus, Grafana
- GitLab CI/CD
---
## Contributors
- Gedi Harish
- Open to contributions!
---
## License
MIT License