Coder Social home page Coder Social logo

masmix / terraform-eks-env-workshop Goto Github PK

View Code? Open in Web Editor NEW

This project forked from god-dev-team/terraform-eks-env-workshop

0.0 1.0 0.0 561 KB

Terraform and helm charts to provide deployment of the full EKS cluster

License: MIT License

HCL 94.51% Shell 5.49%

terraform-eks-env-workshop's Introduction

TERRAFORM-EKS-ENV-WORKSHOP

GitHub Actions status GitHub Releases

⚠️ The repository may be out of date. We split the modules and migrated the repository to god-aws-eks-env. Modules named as https://github.com/GOD-mbh/god-terraform-'name'/tree/main

Terraform and helm charts to provide deployment of the full EKS cluster

Prerequsite

brew update
brew install kubernetes-cli
brew install python3
easy_install pip
pip install awscli — upgrade — user
export PATH=~/.local/bin:$PATH
brew install terraform
brew install terragrunt
brew install direnv
brew install tfenv

Setup .envrc

Setup your KUBECONFIG and aws credentials

export AWS_CONFIG_FILE=
export AWS_SHARED_CREDENTIALS_FILE=
export KUBECONFIG=$(pwd)/eks-vpc/kubeconfig_GOD-EKS

Authorize users to access the cluster

Initially, only the system that deployed the cluster will be able to access the cluster. To authorize other users for accessing the cluster, config needs to be modified by using the steps given below:

  • Modify file eks-vpc/locals.tfas:
locals {

  map_users = [
    {
      userarn  = "arn:aws:iam::${data.aws_caller_identity.current.account_id}:user/tgaleev"
      username = "tgaleev"
      groups   = ["system:masters"]
    }
  ]

  map_roles = []

  map_accounts = []
}

How to use this example

Install EKS

  • cd eks-vpc
  • Run terraform init
  • Run terraform plan and review
  • Run terraform apply

Install helm charts

  • cd charts
  • Run terraform init
  • Run terraform plan and review
  • Run terraform apply

Structure

This repository provides the minimal set of resources, which may be required for starting comfortably developing the process of new IaC project:

main.tf - data from modules

modules.tf - list of modules and their redefined values

providers.tf - list of providers and their values

variables.tf - variables used in modules. Customize it for your project data !!!

variables.tf.json - list of versions for variables. Customize it for your project data !!!

Work with cluster

For destroy some module just remove it from modules.tf and run.

terraform plan -out plan && terraform apply plan

What resources via helm are created

  • external-dns
  • metrics-server
  • ingress-nginx
  • cert-manager
  • archiva
  • sonarqube
  • sonatype-nexus
  • argo
  • weave
  • loki
  • keycloack
  • monitoring (grafana)
  • jenkins

Cleaning up

You can destroy this cluster entirely by running:

terraform plan -destroy
terraform destroy  --force

terraform-eks-env-workshop's People

Contributors

timurgaleev avatar dependabot[bot] avatar mergify[bot] avatar masmix avatar dependabot-preview[bot] avatar

Watchers

James Cloos 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.