Code Monkey home page Code Monkey logo

k8s-app-deployment's Introduction

k8s-app-deployment

Overview

This app uses the following tech stack:

  • Node.JS
  • k6
  • GitHub Actions
  • helm
  • Kubernetes (in the case of the workflows: AWS EKS)
  • Terraform

The app is a small REST app with a single endpoint developed in Node using express, it is located in app/. It is containerized using Docker and pushed to GitHub Container Registry.

The infrastructure on which the app is deployed (by using Helm) is built by a Terraform module contained in terraform/

All of the builds, test, and deployments are automated through GitHub Action Workflows located in .github/workflows.

Once the infra is deployed. The app is then deployed with Helm using the Chart located in helm/. Upon completion, a performance/functional test is launched using k6 (tests located in test/) verifying that the endpoint is responding through the loadbalancer and that it has acceptable response times. If it isn't, the app is removed from the cluster.**

The cluster can be destroyed by a GitHub Action that is executed manually.

** In a real world app setting, the container image would be using semantic-versioning and only the version being deployed would be deleted from the cluster.

How To

Run app in the cloud

Prerequisites:

  • helm
  • an EKS cluster
  • a configured .kubeconfig
  • This repo cloned onto your workstation

Deploy

To deploy the app to your EKS cluster, you simply execute this helm command:

# pwd == repo root
helm install -f helm/values.yaml --set image.branchName=main k8s-app ./helm

Destroy

To destroy the app execute the following helm command:

# pwd == repo root
helm uninstall k8s-app

Run app locally

Prerequisites:

  • node
  • npm

Run the app

npm run start

Run the tests

npm run test

k8s-app-deployment's People

Contributors

anthonygauthier avatar

Watchers

 avatar

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.