https://github.com/iamanonymous419/marketverse-gitops
This is a gitops repository for Argocd that is used to deploy Project Marketverse and explore gitops and devops, and this file contain IAC too with Terraform and Ansible
https://github.com/iamanonymous419/marketverse-gitops
ansible argocd aws devops docker eks-cluster grafana-dashboard helm-chart iac jenkins kubernetes linux makefile prometheus shell-scripting terraform
Last synced: 2 months ago
JSON representation
This is a gitops repository for Argocd that is used to deploy Project Marketverse and explore gitops and devops, and this file contain IAC too with Terraform and Ansible
- Host: GitHub
- URL: https://github.com/iamanonymous419/marketverse-gitops
- Owner: iamanonymous419
- License: mit
- Created: 2025-04-06T07:06:17.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-09-25T09:30:07.000Z (9 months ago)
- Last Synced: 2025-09-25T10:21:55.647Z (9 months ago)
- Topics: ansible, argocd, aws, devops, docker, eks-cluster, grafana-dashboard, helm-chart, iac, jenkins, kubernetes, linux, makefile, prometheus, shell-scripting, terraform
- Language: Shell
- Homepage:
- Size: 392 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Project - MarketVerse Deployment
[](https://www.terraform.io)
[](https://www.ansible.com)
[](https://aws.amazon.com)
[](https://www.jenkins.io)
[](https://argoproj.github.io/cd)
[](https://prometheus.io)
[](https://grafana.com)
MarketVerse is a cloud-native e-commerce platform that can be deployed using Kubernetes and Minikube. This guide provides step-by-step instructions for deploying MarketVerse on Minikube, setting up monitoring with Prometheus and Grafana, using automation with Makefile, and managing deployments with Argo CD.
> [!WARNING]
> This project is for **learning purposes** and aims to explore DevOps best practices.
## References
- [Infrastructure as Code (IaC) Guide](/iac/README.md)
- [Kubernetes Documentation](https://kubernetes.io/docs/)
- [Minikube Documentation](https://minikube.sigs.k8s.io/docs/)
- [Argo CD Documentation](https://argo-cd.readthedocs.io/en/stable/)
- [Prometheus Documentation](https://prometheus.io/docs/introduction/overview/)
- [Grafana Documentation](https://grafana.com/docs/)
---
## Table of Contents
- [Project - MarketVerse Deployment](#project---marketverse-deployment)
- [References](#references)
- [Table of Contents](#table-of-contents)
- [Prerequisites](#prerequisites)
- [Setup and Deployment](#setup-and-deployment)
- [1. Clone the Repository](#1-clone-the-repository)
- [2. Set Up Kubernetes Namespace](#2-set-up-kubernetes-namespace)
- [3. Deploy Database](#3-deploy-database)
- [4. Configure and Push Database Schema](#4-configure-and-push-database-schema)
- [5. Deploy Application](#5-deploy-application)
- [6. Deploy Cron Jobs](#6-deploy-cron-jobs)
- [7. Access the Application](#7-access-the-application)
- [Automated Deployment with Makefile](#automated-deployment-with-makefile)
- [Kubernetes Dashboard in Minikube](#kubernetes-dashboard-in-minikube)
- [Monitoring with Grafana and Prometheus](#monitoring-with-grafana-and-prometheus)
- [Step 1: Install Prometheus and Grafana](#step-1-install-prometheus-and-grafana)
- [Step 2: Expose Prometheus \& Grafana](#step-2-expose-prometheus--grafana)
- [Step 3: Get Grafana Credentials](#step-3-get-grafana-credentials)
- [Argo CD Deployment](#argo-cd-deployment)
- [Step 1: Install Argo CD](#step-1-install-argo-cd)
- [Step 2: Expose Argo CD UI](#step-2-expose-argo-cd-ui)
- [Step 3: Get Argo CD Admin Credentials](#step-3-get-argo-cd-admin-credentials)
- [Infrastructure as Code (IaC) Deployment](#infrastructure-as-code-iac-deployment)
- [Cleanup](#cleanup)
- [๐ MarketVerse is now successfully deployed on Kubernetes with Argo CD! Happy coding! ๐](#-marketverse-is-now-successfully-deployed-on-kubernetes-with-argo-cd-happy-coding-)
---
## Prerequisites
Ensure the following tools are installed before proceeding:
- **Docker** โ [Install Guide](https://docs.docker.com/get-docker/)
- **Minikube** โ [Install Guide](https://minikube.sigs.k8s.io/docs/start/)
- **kubectl** โ [Install Guide](https://kubernetes.io/docs/tasks/tools/)
- **Helm** โ [Install Guide](https://helm.sh/docs/intro/install/)
- **Argo CD** โ [Install Guide](https://argo-cd.readthedocs.io/en/stable/getting_started/)
- **Jenkins** (Optional, for CI/CD) โ [Install Guide](https://www.jenkins.io/doc/book/installing/)
---
## Setup and Deployment
### 1. Clone the Repository
```bash
# Clone the project repository
git clone https://github.com/iamanonymous419/marketverse-gitops.git marketverse-gitops
cd marketverse-gitops
# For a specific branch
git clone -b main https://github.com/iamanonymous419/marketverse-gitops.git marketverse-gitops
cd marketverse-gitops
```
### 2. Set Up Kubernetes Namespace
```bash
kubectl apply -f namespace.yml
```
### 3. Deploy Database
```bash
kubectl apply -f ./database
```
### 4. Configure and Push Database Schema
Before running this command, make sure to set up the database URL of the Minikube service:
```env
DATABASE_URL="postgresql://something:something@localhost:5432/database"
```
Then, forward the database port and push the schema:
```bash
kubectl port-forward service/database-service 5432:5432 -n marketverse &
pnpm exec drizzle-kit push
```
To verify the tables:
```bash
psql -h localhost -U something -d database
```
To access the database pod:
```bash
kubectl exec -it pod/database-0 -n marketverse -- bash
psql -U something -d database
```
### 5. Deploy Application
```bash
kubectl apply -f ./app
```
### 6. Deploy Cron Jobs
```bash
kubectl apply -f ./cron-job
```
### 7. Access the Application
```bash
kubectl port-forward service/marketverse-svc 3000:80 -n marketverse &
```
Now, open [http://localhost:3000](http://localhost:3000) in your browser.
---
## Automated Deployment with Makefile
For easier deployment, use the provided Makefile:
```bash
make create-ns # Create Kubernetes namespace
make delete-ns # Delete Kubernetes namespace
```
```bash
make run-database # Deploy database
make delete-database # Remove database
```
```bash
make run-app # Deploy application
make delete-app # Remove application
```
```bash
make run-job # Deploy scheduled jobs
make remove-job # Remove scheduled jobs
```
```bash
make forward-app # Forward port 3000 for the app
make forward-database # Forward port 5432 for the database
```
๐ ๏ธ **Database Schema:**
```bash
make schema-push # Push latest schema changes to DB
```
๐ **Full Deployment:**
```bash
make run-all # Deploys everything including schema push
```
๐งน **Cleanup:**
```bash
make delete # Deletes all resources
```
---
## Kubernetes Dashboard in Minikube
Enable the Minikube dashboard:
```bash
minikube addons enable dashboard
minikube addons enable metrics-server
minikube dashboard
```
Access the dashboard at:
[http://127.0.0.1:37725/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/](http://127.0.0.1:37989/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/)
---
## Monitoring with Grafana and Prometheus
### Step 1: Install Prometheus and Grafana
```bash
helm install prometheus prometheus-community/kube-prometheus-stack --namespace monitoring --create-namespace
```
### Step 2: Expose Prometheus & Grafana
```bash
kubectl port-forward svc/prometheus-kube-prometheus-prometheus -n monitoring 9090:9090 &
kubectl port-forward svc/prometheus-grafana -n monitoring 4000:80 &
```
### Step 3: Get Grafana Credentials
```bash
kubectl get secret prometheus-grafana -n monitoring -o jsonpath="{.data.admin-password}" | base64 --decode
```
**Username:** `admin`
---
## Argo CD Deployment
### Step 1: Install Argo CD
```bash
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
```
### Step 2: Expose Argo CD UI
```bash
kubectl port-forward svc/argocd-server -n argocd 8080:443 &
```
### Step 3: Get Argo CD Admin Credentials
```bash
kubectl get secret argocd-initial-admin-secret -n argocd -o jsonpath="{.data.password}" | base64 --decode
```
**Username:** `admin`
---
## Infrastructure as Code (IaC) Deployment
> [!IMPORTANT]
> For production-grade AWS EKS deployment using Infrastructure as Code (IaC), please refer to our comprehensive guide:
>
> ๐ **[Marketverse Infrastructure as Code (IaC) with Terraform and Ansible](/iac/README.md)**
This guide provides a complete production-ready infrastructure setup, including:
- โ๏ธ **AWS EKS Cluster** setup using Terraform
- ๐ **CI/CD Pipeline** with Jenkins on AWS EC2
- ๐ **Remote Backend** for secure Terraform state management
- ๐ข **GitOps Deployment** using ArgoCD
- ๐ **Monitoring Stack** with Prometheus and Grafana
- ๐งฉ **Configuration Management** using Ansible



> [!TIP]
> The IaC deployment is ideal for production environments and follows industry best practices for secure, scalable, and maintainable infrastructure.
---
## Cleanup
To delete everything:
```bash
kubectl delete -f namespace.yml
make delete
```
---
### ๐ MarketVerse is now successfully deployed on Kubernetes with Argo CD! Happy coding! ๐