Code Monkey home page Code Monkey logo

terraform-eks's Introduction

Terraform EKS Cluster

PoC for EKS cluster deployment

NOTE: deploying an EKS cluster will incur cost for AWS resources.

Prerequisites

  • Download Heptio Authenticator
    • curl -o heptio-authenticator-aws https://amazon-eks.s3-us-west-2.amazonaws.com/1.10.3/2018-06-05/bin/linux/amd64/heptio-authenticator-aws # Linux
    • curl -o heptio-authenticator-aws https://amazon-eks.s3-us-west-2.amazonaws.com/1.10.3/2018-06-05/bin/darwin/amd64/heptio-authenticator-aws # macOS
  • Install Heptio Authenticator
    • chmod +x heptio-authenticator-aws && sudo mv heptio-authenticator-aws /opt/bin/ # CoreOS
    • chmod +x heptio-authenticator-aws && sudo mv heptio-authenticator-aws /usr/local/bin/ # macOS/Linux
  • Install kubectl
    • curl -o kubectl https://storage.googleapis.com/kubernetes-release/release/v1.10.3/bin/linux/amd64/kubectl
    • chmod +x kubectl && sudo mv kubectl /opt/bin/kubectl # CoreOS
    • chmod +x kubectl && sudo mv kubectl /usr/local/bin/kubectl # macOS/Linux
  • Install Terraform v0.11.7 (SKIP: If already exists in your host)
    • Setup Terraform using official Terraform Docker image
      • chmod +x ./terraform && sudo mv ./terraform /usr/local/bin # macOS/Ubuntu/Fedora
      • chmod +x ./terraform && sudo mv ./terraform /opt/bin # CoreOS/RancherOS
    • terraform config 0.11.7

Quickstart

Deploy

  • Checkout this repo
  • ./eks cluster up # Takes ~15min
  • kubectl apply -f nginx.yaml # Deploy an example Nginx pod
  • export KUBECONFIG=~/.kube/eksconfig
  • kubectl get pods # Check if the Nginx pod is running
  • kubectl get svc -o wide # Locate the service URL for Nginx
  • Copy the Nginx URL from previous step and launch the Nginx welcome page via port 8000
    • URL may look like http://a2ec4e6b66a2411e883240aa8289a10c-778396272.us-west-2.elb.amazonaws.com:8000/

Destroy

  • kubectl delete -f nginx.yaml # Delete Nginx pod if deployed based on the sample
  • terraform destroy # Takes ~15min

Credits

terraform-eks's People

Contributors

yamaszone avatar jamesrenfro avatar ghpua avatar

Watchers

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