Giter VIP home page Giter VIP logo

eks-automation's Introduction

Kubernetes-automation

Automating Kubernetes setup on AWS using :-

  1. Cloudformation(For creating CodeBuild)
  2. CodeBuild(For Continuous Integration)
  3. Terraform(for creating kubernetes-infrastructure)

Why Run Terraform inside AWS Codebuild

  1. Every person in the company can create infrastructure using Terraform, without any configuration in their own laptop.
  2. You can provide a web interface to use Terraform and anyone in the company can create infrastructures
  3. All terraform output logs are saved in Cloudwatch
  4. You can run by schedule
  5. You can run with an hook every time the code changes
  6. You don’t need any infrastructure to run, no EC2 virtual machines no fix cost. You pay only for minutes you use
  7. You can build a small orchestrator running for example a python script before and after the terraform run

Steps for this example

Choose a region, everything will be created in that region

1 - run the cloudformation file

This will create 3 objects:

  1. A codebuild role with administrator access
  2. An S3 bucket where the tfstate file will be saved
  3. A codebuild project that will run the code

2 - run the codebuild to create your terraform environment

To do this this is necessary click on the “Start the build" (blue button) inside codebuild.

This will trigger the creation of the security group in your environment.

Take a look to the CloudWatch logs and verify that everything is green in codebuild

The video for the steps 1 and 2 is this

Run Terraform inside AWS Codebuild part 1/2 creation

3 - destroy the security group running a terraform destroy

  1. click on "Start the build" (Blue button)
  2. Change the destroy variable to True
  3. click on "Start the build" (Blue button)

4 - clean the environment

  1. empty the bucket
  2. delete the cloudformation template

The video for the steps 3 and 4 is this

Run Terraform inside AWS Codebuild part 2/2 destroy and cleanup

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.