This repository contains application source code for microservices, Kubernetes manifests, and application Helm charts that can be deployed to a Kubernetes cluster.
The applications used for demonstrative purposes are Orders
and Products
. The applications are written in JavaScript (NodeJS based APIs). The Orders API returns a list of orders, whereas the products API returns a list of products.
The application source code for the microservices is in the microservices
folder.
When running the microservices locally or in your Amazon EKS cluster, you can use the following API endpoints for testing purposes.
GET Orders - /v1/orders
GET Orders and Products - /v1/orders/products
GET Products - /v1/products
Repository: public.ecr.aws/k3d0y0m9/ecommerce/orders
Image tag: "0.0.1"
Repository: public.ecr.aws/k3d0y0m9/ecommerce/products
Image tag: "0.0.1"
The raw-manifests
folder contains the Kubernetes manifests for both microservices. These files can be used to deploy the applications to a Kubernetes cluster. In order to expose these applications to external traffic, you should first install the Load Balancer Controller and then deploy the Ingress resource (ingress.yaml
). Alternatively, you can update the Services
from a ClusterIP
to LoadBalancer
.
It's a best practice to use an Ingress controller like the Load Balancer Controller to expose your applications to external traffic.
.
|-- deployments.png
|-- ingress.yaml
|-- orders-deployment.yaml
|-- orders-service.yaml
|-- orders.yaml
|-- products-deployment.yaml
|-- products-service.yaml
|-- products.yaml
`-- service.png
Example:
cd ./raw-manifests
kubectl apply -f ingress.yaml,service.yaml,deployment.yaml
The helm
folder contains the Helm charts for both microservices. Helm is a package manager for Kubernetes resources. Instead of managing multiple Kubernetes manifests, you can use Helm to manage the deployment lifecycle for your Kubernetes applications. It also has a templating engine to automatically generate the relevant resources for a given application.
.
|-- orders
| |-- Chart.yaml
| |-- charts
| |-- orders.yaml
| |-- templates
| | |-- NOTES.txt
| | |-- _helpers.tpl
| | |-- deployment.yaml
| | |-- hpa.yaml
| | |-- ingress.yaml
| | |-- service.yaml
| | |-- serviceaccount.yaml
| | `-- tests
| `-- values.yaml
`-- products
|-- Chart.yaml
|-- charts
|-- templates
| |-- NOTES.txt
| |-- _helpers.tpl
| |-- deployment.yaml
| |-- hpa.yaml
| |-- ingress.yaml
| |-- service.yaml
| |-- serviceaccount.yaml
| `-- tests
`-- values.yaml
Example:
cd ./helm/orders
helm install -f values.yaml orders .
.
|-- service.yaml
|-- statefulset.png
`-- statefulset.yaml
The .github/workflows
folder contains the main.yaml configuration file the is used to configure the build and deployment process in GitHub Actions.
Important note: Remember to create/add the relevant secrets (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, EKS_CLUSTER, EKS_REGION) for your GitHub Actions deployment process.
.
`-- workflows
`-- main.yaml