Coder Social home page Coder Social logo

terraform-eks's Introduction

Test task

Automate EKS cluster setup on AWS

You've joined a new and growing startup. The company wants to build its initial Kubernetes infrastructure on AWS.

They have asked you if you can help create the following:

  • Terraform code that deploys an EKS cluster (whatever latest version is currently available) into an existing VPC
  • The terraform code should also prepare anything needed for a pod to be able to assume an IAM role
  • Include a short readme that explains how to use the Terraform repo and that also demonstrates how an end-user (a developer from the company) can run a pod on this new EKS cluster and also have an IAM role assigned that allows that pod to access an S3 bucket.

HowTo deploy

Prerequisites

  • AWS account
    • access key / secret key for API access with proper permissions
    • aws-cli v2
  • terraform >= v1.5
  • kubectl >= v1.26

Steps:

  • git clone this repo and deploy tf modules
terraform init
terraform apply

After everything was created - update k8s config and apply test-pod manifest (use your AWS account id instead placeholder, also replace it inside test_pod.yaml):

aws eks update-kubeconfig --region eu-west-1 --name test-eks-cluster
kubectl config use-context arn:aws:eks:eu-west-1:1111111111:cluster/test-eks-cluster
kubectl apply -f test_pod.yaml

After pod created you have to go inside and install awscli to check s3 access:

kubectl exec -it test-pod -- bash

Inside pod:

apt update
apt install -y awscli
aws s3 ls

terraform-eks's People

Watchers

Igor Ivanov 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.