This repository contains Kubernetes manifests for deploying the NovelNest application - a microservices-based online bookstore platform - to a Kubernetes cluster.
NovelNest is an online bookstore application that allows users to browse a catalog of books, manage inventory, place orders, and authenticate users. The application is built using a microservices architecture, with each service responsible for a specific domain.
The NovelNest application consists of the following components, all deployed via Kubernetes:
Component | Description | Database |
---|---|---|
Frontend UI | Web interface for the NovelNest application | - |
User Service | Handles user authentication and management | PostgreSQL |
Catalog Service | Manages the book catalog and details | MongoDB |
Inventory Service | Manages book inventory and stock levels | PostgreSQL |
Order Service | Processes customer orders | PostgreSQL |
Kong API Gateway | Routes and manages API traffic to backend services | PostgreSQL |
RabbitMQ | Message broker for service-to-service communication | - |
Before you begin, ensure you have the following tools installed:
- kubectl - Kubernetes command-line tool
- A Kubernetes cluster, you can use one of the following:
- Docker - Container runtime
- Git - Version control
git clone https://github.com/NovelNestHQ/k8s-manifests.git
cd k8s-manifests
The easiest way to deploy NovelNest is using the provided deployment script:
chmod +x deploy-all.sh
./deploy-all.sh
This script will:
- Create a 'novelnest' namespace if it doesn't exist
- Deploy Kong API Gateway and RabbitMQ
- Deploy User Service with its database
- Deploy Catalog Service with its database
- Deploy Inventory Service with its database
- Deploy Order Service with its database
- Deploy the NovelNest UI
If you prefer to deploy components individually, follow these steps:
-
Create the Kubernetes namespace:
kubectl create namespace novelnest kubectl config set-context --current --namespace=novelnest
-
Deploy RabbitMQ:
kubectl apply -f ./rabbitmq.yaml
-
Deploy Kong Gateway:
cd kong-gateway ./deploy-kong.sh cd ..
-
Deploy User Service:
cd user-service ./deploy-user-service.sh cd ..
-
Deploy Catalog Service:
cd catalog-service ./deploy-catalog-service.sh cd ..
-
Deploy Inventory Service:
cd inventory-service ./deploy-inventory-service.sh cd ..
-
Deploy Order Service:
cd order-service ./deploy-order-service.sh cd ..
-
Deploy NovelNest UI:
kubectl apply -f ./novelnest-ui.yaml
After deployment, you can access the NovelNest application using port-forwarding:
# Forward the frontend UI
kubectl port-forward svc/novelnest-ui 5173:5173 -n novelnest &
# Forward Kong API Gateway
kubectl port-forward service/kong 8000:8000 8001:8001 8002:8002 -n novelnest &
Then you can access:
- NovelNest UI: http://localhost:5173
- Kong Gateway Dashboard: http://localhost:8002
- API Endpoints via Kong: http://localhost:8000
k8s-manifests/
├── deploy-all.sh # Main deployment script
├── novelnest-ui.yaml # Frontend UI deployment
├── rabbitmq.yaml # RabbitMQ message broker
├── catalog-service/ # Catalog service manifests
│ ├── catalog-service.yaml
│ ├── deploy-catalog-service.sh
│ └── mongodb-catalog.yaml
├── inventory-service/ # Inventory service manifests
│ ├── deploy-inventory-service.sh
│ ├── inventory-service-migrations.yaml
│ ├── inventory-service.yaml
│ └── postgres-inventory.yaml
├── kong-gateway/ # API Gateway manifests
│ ├── deploy-kong.sh
│ ├── kong-config.yaml
│ ├── kong-configurator.yaml
│ ├── kong-migrations.yaml
│ ├── kong.yaml
│ └── postgres-kong.yaml
├── order-service/ # Order service manifests
│ ├── deploy-order-service.sh
│ ├── order-service-migrations.yaml
│ ├── order-service.yaml
│ └── postgres-order.yaml
└── user-service/ # User service manifests
├── deploy-user-service.sh
├── postgres-auth.yaml
├── postgres-user.yaml
├── supertokens-admin-create.yaml
├── supertokens.yaml
├── user-service-migrations.yaml
└── user-service.yaml
To remove all resources created by this deployment:
# Delete all resources in the novelnest namespace
kubectl delete namespace novelnest
# Or, to delete specific resources without deleting the namespace
kubectl delete -f novelnest-ui.yaml -n novelnest
kubectl delete -f rabbitmq.yaml -n novelnest
kubectl delete -f ./user-service/ -n novelnest
kubectl delete -f ./catalog-service/ -n novelnest
kubectl delete -f ./inventory-service/ -n novelnest
kubectl delete -f ./order-service/ -n novelnest
kubectl delete -f ./kong-gateway/ -n novelnest
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter issues during deployment:
-
Check pod status:
kubectl get pods -n novelnest
-
Check pod logs:
kubectl logs <pod-name> -n novelnest
-
Verify service endpoints:
kubectl get endpoints -n novelnest
-
Ensure all services are running:
kubectl get svc -n novelnest