Code Monkey home page Code Monkey logo

terraform-aws-eks-recipe's Introduction

EKS Cluster

Usage:

  cluster_name                    = "kubecloud-eks-2"
  cluster_subnets                 = ["subnet-06e919d48f43eba1b", "subnet-0820c186039b2d4ac"]
  cluster_version                 = "1.27"
  cluster_endpoint_private_access = false
  cluster_endpoint_public_access  = true
  cluster_public_access_cidrs     = ["0.0.0.0/0"]
  cluster_service_ipv4_cidr       = "172.16.0.0/12"
  cluster_log_types               = ["api", "audit", "authenticator", "controllerManager", "scheduler"]
  attach_eks_oidc_with_iam        = true
  
  # managed nodegroup
  node_groups = {
  
    one = {
      node_group_name = "kubecloud-eks-nodegroup-public"
      subnet_ids      = ["subnet-021604cca828cfb0d", "subnet-06c70c11d9fbd5fd5"]
      ami_type        = "AL2_x86_64"
      capacity_type   = "ON_DEMAND"
      disk_size       = 8
      instance_types  = ["t3.small"]
      desired_size    = 4
      min_size        = 4
      max_size        = 10
      max_unavailable = 1
      tags = {
        Name = "kubecloud-eks-nodegroup"
      }
    },
  
    two = {
      node_group_name = "kubecloud-eks-nodegroup-private"
      subnet_ids      = ["subnet-057c23897b5ea074f", "subnet-014e8b35dc15e7f29", ]
      ami_type        = "AL2_x86_64"
      capacity_type   = "ON_DEMAND"
      disk_size       = 8
      instance_types  = ["t2.micro"]
      desired_size    = 0
      min_size        = 0
      max_size        = 8
      max_unavailable = 1
      tags = {
        Name = "kubecloud-eks-nodegroup"
      }
    }
  
  }


Provision AWS EKS cluster on an existing VPC

Suppose, there are 6 subnets with following subnet Id's:

intra_subnet_id = [
  "subnet-06e919d48f43eba1b",
  "subnet-0820c186039b2d4ac",
]
private_subnet_id = [
  "subnet-057c23897b5ea074f",
  "subnet-014e8b35dc15e7f29",
]
public_subnet_id = [
  "subnet-021604cca828cfb0d",
  "subnet-06c70c11d9fbd5fd5",
]

Now, we will deploy our EKS cluster in a way that EKS cluster's X-ENI will be created on intra_subnets .

intra_subnets: private subnet without any NAT gateway attached.

create_new_vpc                  = false
cluster_name                    = "eks-cluster"
existing_cluster_subnets        = ["subnet-06e919d48f43eba1b", "subnet-0820c186039b2d4ac"]
cluster_version                 = "1.27"
cluster_endpoint_private_access = false
cluster_endpoint_public_access  = true
cluster_public_access_cidrs     = ["0.0.0.0/0"]
cluster_service_ipv4_cidr       = "172.16.0.0/12"
cluster_log_types               = ["api", "audit", "authenticator", "controllerManager", "scheduler"]

# managed nodegroup
node_groups = {

  one = {
    node_group_name = "kubecloud-eks-nodegroup-public"
    subnet_ids      = ["subnet-021604cca828cfb0d", "subnet-06c70c11d9fbd5fd5"]
    ami_type        = "AL2_x86_64"
    capacity_type   = "ON_DEMAND"
    disk_size       = 20
    instance_types  = ["t2.micro"]
    desired_size    = 2
    min_size        = 2
    max_size        = 4
    max_unavailable = 1
    tags = {
      Name = "kubecloud-eks-nodegroup"
    }
  },

  two = {
    node_group_name = "kubecloud-eks-nodegroup-private"
    subnet_ids      = ["subnet-057c23897b5ea074f", "subnet-014e8b35dc15e7f29", ]
    ami_type        = "AL2_x86_64"
    capacity_type   = "ON_DEMAND"
    disk_size       = 20
    instance_types  = ["t2.micro"]
    desired_size    = 1
    min_size        = 1
    max_size        = 4
    max_unavailable = 1
    tags = {
      Name = "kubecloud-eks-nodegroup"
    }
  }

}

Notes:

VPC

If you want to create a new vpc where you will create EKS cluster, follow the link.

  • Read about EKS VPC requirements

Test Cases


To-Do

  • Integarte EKS CSI
  • Create automated Storage Classs
  • Integarte Cluster AutoScaler

terraform-aws-eks-recipe's People

Contributors

shamimice03 avatar

Stargazers

 avatar

Watchers

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