Code Monkey home page Code Monkey logo

eks-ecr-gitops-tf's Introduction

CI/CD and GitOps - Terraform, GitHub Actions and Kubernetes

This repository is a part of my GitHub Actions: CI/CD and GitOps project. It contains terraform files that will create a custom VPC, subnets, and a three-node EKS cluster. All of this will be provisioned using GitHub Actions. I have made every necessary file public, so you can follow along and test this project as well.

Caution

This project is for testing purposes. It is strongly advised against using it for production.

Project Hierarchy

  • /.github/workflows: GitHub actions file
  • /terraform: Terraform files

Architecture Overview

Architecture

Prerequisites

  • AWS CLI Setup
  • Terraform CLI Setup
  • GitHub Account

Technologies

  • AWS (EKS, S3)
  • Terraform
  • GitHub Actions

Note

My last build is intentionally failed as I removed my secrets for security purposes.

How to test this project

Clone the repository

git clone https://github.com/YU88John/eks-ecr-gitops-tf.git

Create S3 Bucket for Terraform State

The GitHub Actions will be triggered based on the push events to /terraform directory.

We need terraform state to keep track of the state of actual infrastructure. If we don't have a state file, a whole new infrastructure will be created every time the push event occurs. Read more about this.

For this project, we will create an S3 bucket to store that terraform state file. You can create via cli:

aws s3 mb --region us-east-1 s3://<your_unique_name>

Setup Secrets

To apply terraform from GitHub Actions, it needs permissions on AWS resources. Moreoever, the bucket name will also be fetched as a Secret. Create GitHub Secrets with the following keys and your respective values.

AWS_ACCESS_KEY_ID

AWS_SECRET_ACCESS_KEY

BUCKET_TF_STATE

Replace your values

You need to replace your values in /terraform/terraform.tf. The snippet is as below:

backend "s3" {
    bucket = ""
    key    = "terraform.tfstate"
    region = "us-east-1"
  }

eks-ecr-gitops-tf's People

Contributors

jvne8 avatar yu88john 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.