Giter Club home page Giter Club logo

microservices-for-kubernetes's Introduction

Deploying Microservices to Amazon EKS

This repository contains application source code for microservices, Kubernetes manifests, and application Helm charts that can be deployed to a Kubernetes cluster.

Alt text

About the Microservices

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.

Microservices

The application source code for the microservices is in the microservices folder.

Orders API

Alt text

Products API

Alt text

Endpoints for Microservices

When running the microservices locally or in your Amazon EKS cluster, you can use the following API endpoints for testing purposes.

Orders

GET Orders - /v1/orders
GET Orders and Products - /v1/orders/products

Products

GET Products - /v1/products

Container Image Repositories

Orders

Repository: public.ecr.aws/k3d0y0m9/ecommerce/orders
Image tag: "0.0.1"

Products

Repository: public.ecr.aws/k3d0y0m9/ecommerce/products
Image tag: "0.0.1"

Raw Manifests

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

Helm Charts

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 .

Stateful Application

.
|-- service.yaml
|-- statefulset.png
`-- statefulset.yaml

GitHub Actions Deployment Config

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

microservices-for-kubernetes's People

Contributors

lukemwila avatar

Forkers

tagem0512

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.