Giter Club home page Giter Club logo

tanmay16111999 / ci-cd_eks-github_actions Goto Github PK

View Code? Open in Web Editor NEW

This project forked from notharshhaa/ci-cd_eks-github_actions

0.0 0.0 0.0 11 KB

𝑬𝒏𝒅-𝒕𝒐-𝑬𝒏𝒅 π‘ͺ𝑰/π‘ͺ𝑫 π‘·π’Šπ’‘π’†π’π’Šπ’π’† 𝒇𝒐𝒓 π‘Ίπ’Šπ’Žπ’‘π’π’† 𝑡𝒐𝒅𝒆 𝑨𝒑𝒑 π‘«π’†π’‘π’π’π’šπ’Žπ’†π’π’• 𝒐𝒏 𝑨𝑾𝑺 𝑬𝑲𝑺

JavaScript 28.17% Python 1.80% HCL 68.31% Dockerfile 1.72%

ci-cd_eks-github_actions's Introduction

End-to-End CI/CD Pipeline for Simple Node App Deployment on EKS using GitHub Actions

github-actions

Table of Contents

Repository Structure

The repository is organized into several key directories:

β”œβ”€β”€ app
β”‚   β”œβ”€β”€ app.py
β”‚   β”œβ”€β”€ calculator.js
β”‚   β”œβ”€β”€ calculator.test.js
β”‚   β”œβ”€β”€ Dockerfile
β”‚   β”œβ”€β”€ Dockerfile-python
β”‚   β”œβ”€β”€ index.js
β”‚   └── package.json
β”œβ”€β”€ kustomize
β”‚   β”œβ”€β”€ base
β”‚   β”‚   β”œβ”€β”€ deploy.yaml
β”‚   β”‚   β”œβ”€β”€ ingress.yaml
β”‚   β”‚   β”œβ”€β”€ kustomization.yaml
β”‚   β”‚   └── svc.yaml
β”‚   └── overlays
β”‚       β”œβ”€β”€ dev
β”‚       β”‚   β”œβ”€β”€ deploy-dev.yaml
β”‚       β”‚   β”œβ”€β”€ ingress-dev.yaml
β”‚       β”‚   β”œβ”€β”€ kustomization.yaml
β”‚       β”‚   └── svc-dev.yaml
β”‚       β”œβ”€β”€ prod
β”‚       β”‚   β”œβ”€β”€ deploy-prod.yaml
β”‚       β”‚   β”œβ”€β”€ ingress-prod.yaml
β”‚       β”‚   β”œβ”€β”€ kustomization.yaml
β”‚       β”‚   └── svc-prod.yaml
β”‚       └── staging
β”‚           β”œβ”€β”€ deploy-staging.yaml
β”‚           β”œβ”€β”€ ingress-staging.yaml
β”‚           β”œβ”€β”€ kustomization.yaml
β”‚           └── svc-staging.yaml
β”œβ”€β”€ README.md
β”œβ”€β”€ terraform
β”‚   β”œβ”€β”€ ingress-nginx.tf
β”‚   β”œβ”€β”€ main.tf
β”‚   β”œβ”€β”€ outputs.tf
β”‚   β”œβ”€β”€ terraform.tf
β”‚   └── variables.tf
└── VERSION

CI/CD Workflow

Build Job

The build job performs several key tasks:

  1. Environment Setup: Node.js environment is set up and dependencies are installed.
  2. Run Tests: Executes unit tests for the application.
  3. Determine Version Increment: Checks the commit message to determine if the version needs to be incremented using Semantic Versioning scheme.
  4. Docker Build and Push: Builds a Docker image and pushes it to a registry.

Deployment Job

The deployment job handles the following:

  1. Terraform Setup: Initializes Terraform and sets up the backend with different state files.
  2. Terraform Plan and Apply: Executes terraform plan and terraform apply to provision environment specific infrastructure.
  3. Kubernetes Configuration: Configures kubectl to interact with the Kubernetes cluster.
  4. Ingress Controller Setup: Uses Helm to install the ingress controller.
  5. Application Deployment: Uses kubectl to deploy the Kustomized application manifests.

Infrastructure Details

  • Dev Environment: Uses t3.small EC2 instances and deploys a single replica.
  • Staging Environment: Uses t3.medium EC2 instances and deploys three replicas.
  • Prod Environment: Uses t3.large EC2 instances and deploys three replicas.

DNS for all environments is automatically managed via Cloudflare and environment-specific subdomains are assigned and pointed to their respective LB hostname (using CNAME) ie., dev.afraz.dev, staging.afraz.dev and prod.afraz.dev.

Notifications

Slack notifications are configured to send updates at the end of each job. This provides immediate feedback on the success or failure of the pipeline and also updates on the DNS changes if applicable.

GitOps Principles

The pipeline adheres to GitOps principles, where Git serves as the single source of truth. Any change to the application or infrastructure is expected to be made through a Git commit.

Hit the Star! ⭐

If you are planning to use this repo for learning, please hit the star. Thanks!

Author by Harshhaa Reddy

ci-cd_eks-github_actions's People

Contributors

notharshhaa 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.