Welcome to the Microservice Application, a modern, cloud-native system featuring three interconnected services: order-service, payment-service, and user-service. Built with FastAPI π, containerized using Docker π³, and deployed on Kubernetes βΈοΈ with Helm for package management and Istio for service mesh capabilities, this application showcases scalable microservice architecture with advanced traffic management, observability, and security.
deployment.sh: Automates Helm/Istio installation, namespace setup, and microservice deployment.fastapi-microservice-app-*.tgz: Helm chart versions (1.0.0, 1.2.0, 1.3.0 - latest).index.yaml: Helm chart repository index.microservice-app/: Unpacked Helm chart for microservices.notes.md: Detailed setup, security, and networking notes.src/: Source code for order-service, payment-service, and user-service.Dockerfile (per service): Docker configurations for containerizing microservices.payment-service for payment processing and user-service for user validation./orders).order-service./payments).order-service./users).Each service is built with FastAPI, containerized with Docker, and deployed as Kubernetes pods managed by Helm charts.
The application leverages a microservice architecture where:
user-service for user validation and payment-service for payment processing.order-service.mongo namespace) serves as the persistent storage.The Kiali console visualizes these interactions, showing traffic flow between services and MongoDB:
Ensure the following are set up before deployment:
deployment.sh) π¦.deployment.sh for service mesh features π./etc/hosts for DNS configuration π§.The deployment.sh script automates the setup and deployment process. Follow these steps:
git clone <repository-url>
cd <repository-directory>
chmod +x deployment.sh
./deployment.sh
demo profile for service mesh features.mongo and api namespaces with Istio sidecar injection.microservice-gateway.k8s.dns to the Istio ingress gatewayβs ClusterIP in /etc/hosts.https://omkar-shelke25.github.io/Helm-Istio-Microservice-App-deploy/) and installs version 1.3.0.http://microservice-gateway.k8s.dnsorder-service: /orders π¦payment-service: /payments π³user-service: /users π€/etc/hosts includes the mapping for microservice-gateway.k8s.dns to the istio-ingressgateway ClusterIP.Below are example API calls with their expected outputs, as shown in the provided screenshots.
curl -X POST http://microservice-gateway.k8s.dns/users/ \
-H "Content-Type: application/json" \
-d '{"name":"John Doe","email":"john@example.com"}' | jq
curl -X POST http://microservice-gateway.k8s.dns/users/ \
-H "Content-Type: application/json" \
-d '{"name":"Omkar","email":"shelke"}' | jq
Output: Creates users and stores them in MongoDB.
curl -X GET http://microservice-gateway.k8s.dns/users/ | jq
Output: Displays a list of created users.
curl -X POST http://microservice-gateway.k8s.dns/orders/ \
-H "Content-Type: application/json" \
-d '{"user_id":"686aa16b1858e2c497a1cd93","product":"Laptop","amount":999.99}' | jq
Output: Creates an order linked to a user.
curl -X GET http://microservice-gateway.k8s.dns/orders/ | jq
Output: Shows orders associated with user IDs.
curl -X POST http://microservice-gateway.k8s.dns/payments/ \
-H "Content-Type: application/json" \
-d '{"order_id":"686aa21c9fb5eb202be21db8","amount":999.99,"status":"successful"}' | jq
Output: Confirms payment for an order.
curl -X GET http://microservice-gateway.k8s.dns/payments/ | jq
Output: Displays payment records.
Istio provides robust observability through integration with Kiali, Prometheus, and Jaeger. The Kiali console visualizes service-to-service communication and interactions with MongoDB in the mongo namespace, offering insights into traffic flow and dependencies.
VirtualService and DestinationRule for intelligent routing and load balancing.microservice-app/values.yaml to adjust replicas, resource limits, or other settings.VirtualService or DestinationRule for advanced routing.values.yaml for production databases.This project is licensed under the MIT License. See the LICENSE file for details.
The Microservice Application demonstrates a robust, scalable, and secure cloud-native architecture, leveraging FastAPI, Docker, Kubernetes, Helm, and Istio. With automated deployment via deployment.sh, seamless service interactions, and powerful observability through Kiali, this project serves as an excellent foundation for building and deploying microservices. The included API examples and visualizations (via Kiali) showcase its functionality, making it ideal for developers exploring modern microservice patterns or deploying production-ready systems. Contributions and feedback are encouraged to further enhance this project! π