|
| 1 | +--- |
| 2 | +# |
| 3 | +# This is the canonical configuration for the `README.md` |
| 4 | +# Run `make readme` to rebuild the `README.md` |
| 5 | +# |
| 6 | + |
| 7 | +# Name of this project |
| 8 | +name: terraform-aws-eks-node-group |
| 9 | + |
| 10 | +# Logo for this project |
| 11 | +#logo: docs/logo.png |
| 12 | + |
| 13 | +# License of this project |
| 14 | +license: "APACHE2" |
| 15 | + |
| 16 | +# Canonical GitHub repo |
| 17 | +github_repo: cloudposse/terraform-aws-eks-node-group |
| 18 | + |
| 19 | +# Badges to display |
| 20 | +badges: |
| 21 | + - name: "Codefresh Build Status" |
| 22 | + image: "https://g.codefresh.io/api/badges/pipeline/cloudposse/terraform-modules%2Fterraform-aws-eks-node-group?type=cf-1" |
| 23 | + url: "https://g.codefresh.io/public/accounts/cloudposse/pipelines/5dead6c731a1a7177ed48f8e" |
| 24 | + - name: "Latest Release" |
| 25 | + image: "https://img.shields.io/github/release/cloudposse/terraform-aws-eks-node-group.svg" |
| 26 | + url: "https://github.com/cloudposse/terraform-aws-eks-node-group/releases/latest" |
| 27 | + - name: "Slack Community" |
| 28 | + image: "https://slack.cloudposse.com/badge.svg" |
| 29 | + url: "https://slack.cloudposse.com" |
| 30 | + |
| 31 | +related: |
| 32 | + - name: "terraform-aws-eks-cluster" |
| 33 | + description: "Terraform module to provision an EKS cluster on AWS" |
| 34 | + url: "https://github.com/cloudposse/terraform-aws-eks-cluster" |
| 35 | + - name: "terraform-aws-eks-workers" |
| 36 | + description: "Terraform module to provision an AWS AutoScaling Group, IAM Role, and Security Group for EKS Workers" |
| 37 | + url: "https://github.com/cloudposse/terraform-aws-eks-workers" |
| 38 | + - name: "terraform-aws-ec2-autoscale-group" |
| 39 | + description: "Terraform module to provision Auto Scaling Group and Launch Template on AWS" |
| 40 | + url: "https://github.com/cloudposse/terraform-aws-ec2-autoscale-group" |
| 41 | + - name: "terraform-aws-ecs-container-definition" |
| 42 | + description: "Terraform module to generate well-formed JSON documents (container definitions) that are passed to the aws_ecs_task_definition Terraform resource" |
| 43 | + url: "https://github.com/cloudposse/terraform-aws-ecs-container-definition" |
| 44 | + - name: "terraform-aws-ecs-alb-service-task" |
| 45 | + description: "Terraform module which implements an ECS service which exposes a web service via ALB" |
| 46 | + url: "https://github.com/cloudposse/terraform-aws-ecs-alb-service-task" |
| 47 | + - name: "terraform-aws-ecs-web-app" |
| 48 | + description: "Terraform module that implements a web app on ECS and supports autoscaling, CI/CD, monitoring, ALB integration, and much more" |
| 49 | + url: "https://github.com/cloudposse/terraform-aws-ecs-web-app" |
| 50 | + - name: "terraform-aws-ecs-codepipeline" |
| 51 | + description: "Terraform module for CI/CD with AWS Code Pipeline and Code Build for ECS" |
| 52 | + url: "https://github.com/cloudposse/terraform-aws-ecs-codepipeline" |
| 53 | + - name: "terraform-aws-ecs-cloudwatch-autoscaling" |
| 54 | + description: "Terraform module to autoscale ECS Service based on CloudWatch metrics" |
| 55 | + url: "https://github.com/cloudposse/terraform-aws-ecs-cloudwatch-autoscaling" |
| 56 | + - name: "terraform-aws-ecs-cloudwatch-sns-alarms" |
| 57 | + description: "Terraform module to create CloudWatch Alarms on ECS Service level metrics" |
| 58 | + url: "https://github.com/cloudposse/terraform-aws-ecs-cloudwatch-sns-alarms" |
| 59 | + - name: "terraform-aws-ec2-instance" |
| 60 | + description: "Terraform module for providing a general purpose EC2 instance" |
| 61 | + url: "https://github.com/cloudposse/terraform-aws-ec2-instance" |
| 62 | + - name: "terraform-aws-ec2-instance-group" |
| 63 | + description: "Terraform module for provisioning multiple general purpose EC2 hosts for stateful applications" |
| 64 | + url: "https://github.com/cloudposse/terraform-aws-ec2-instance-group" |
| 65 | + |
| 66 | +# Short description of this project |
| 67 | +description: |- |
| 68 | + Terraform module to provision an EKS Node Group for [Elastic Container Service for Kubernetes](https://aws.amazon.com/eks/). |
| 69 | +
|
| 70 | + Instantiate it multiple times to create many EKS node groups with specific settings such as GPUs, EC2 instance types, or autoscale parameters. |
| 71 | +
|
| 72 | +introduction: |- |
| 73 | +
|
| 74 | +# How to use this project |
| 75 | +usage: |- |
| 76 | +
|
| 77 | + For a complete example, see [examples/complete](examples/complete). |
| 78 | +
|
| 79 | + For automated tests of the complete example using [bats](https://github.com/bats-core/bats-core) and [Terratest](https://github.com/gruntwork-io/terratest) (which tests and deploys the example on AWS), see [test](test). |
| 80 | +
|
| 81 | + ```hcl |
| 82 | + provider "aws" { |
| 83 | + region = var.region |
| 84 | + } |
| 85 | +
|
| 86 | + module "label" { |
| 87 | + source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.16.0" |
| 88 | + namespace = var.namespace |
| 89 | + name = var.name |
| 90 | + stage = var.stage |
| 91 | + delimiter = var.delimiter |
| 92 | + attributes = compact(concat(var.attributes, list("cluster"))) |
| 93 | + tags = var.tags |
| 94 | + } |
| 95 | +
|
| 96 | + locals { |
| 97 | + tags = merge(module.label.tags, map("kubernetes.io/cluster/${module.label.id}", "shared")) |
| 98 | + } |
| 99 | +
|
| 100 | + module "vpc" { |
| 101 | + source = "git::https://github.com/cloudposse/terraform-aws-vpc.git?ref=tags/0.8.1" |
| 102 | + namespace = var.namespace |
| 103 | + stage = var.stage |
| 104 | + name = var.name |
| 105 | + attributes = var.attributes |
| 106 | + cidr_block = var.vpc_cidr_block |
| 107 | + tags = local.tags |
| 108 | + } |
| 109 | +
|
| 110 | + module "subnets" { |
| 111 | + source = "git::https://github.com/cloudposse/terraform-aws-dynamic-subnets.git?ref=tags/0.18.1" |
| 112 | + availability_zones = var.availability_zones |
| 113 | + namespace = var.namespace |
| 114 | + stage = var.stage |
| 115 | + name = var.name |
| 116 | + attributes = var.attributes |
| 117 | + vpc_id = module.vpc.vpc_id |
| 118 | + igw_id = module.vpc.igw_id |
| 119 | + cidr_block = module.vpc.vpc_cidr_block |
| 120 | + nat_gateway_enabled = false |
| 121 | + nat_instance_enabled = false |
| 122 | + tags = local.tags |
| 123 | + } |
| 124 | +
|
| 125 | + module "eks_cluster" { |
| 126 | + source = "git::https://github.com/cloudposse/terraform-aws-eks-cluster.git?ref=tags/0.13.0" |
| 127 | + namespace = var.namespace |
| 128 | + stage = var.stage |
| 129 | + name = var.name |
| 130 | + attributes = var.attributes |
| 131 | + tags = var.tags |
| 132 | + region = var.region |
| 133 | + vpc_id = module.vpc.vpc_id |
| 134 | + subnet_ids = module.subnets.public_subnet_ids |
| 135 | + kubernetes_version = var.kubernetes_version |
| 136 | + kubeconfig_path = var.kubeconfig_path |
| 137 | + oidc_provider_enabled = var.oidc_provider_enabled |
| 138 | +
|
| 139 | + workers_role_arns = [module.eks_node_group.eks_node_group_role_arn] |
| 140 | + workers_security_group_ids = [] |
| 141 | + } |
| 142 | +
|
| 143 | + module "eks_node_group" { |
| 144 | + source = "git::https://github.com/cloudposse/terraform-aws-eks-node-group.git?ref=master" |
| 145 | + namespace = var.namespace |
| 146 | + stage = var.stage |
| 147 | + name = var.name |
| 148 | + attributes = var.attributes |
| 149 | + tags = var.tags |
| 150 | + vpc_id = module.vpc.vpc_id |
| 151 | + subnet_ids = module.subnets.public_subnet_ids |
| 152 | + instance_types = var.instance_types |
| 153 | + desired_size = var.desired_size |
| 154 | + min_size = var.min_size |
| 155 | + max_size = var.max_size |
| 156 | + cluster_name = module.eks_cluster.eks_cluster_id |
| 157 | + kubernetes_version = var.kubernetes_version |
| 158 | + } |
| 159 | + ``` |
| 160 | +
|
| 161 | +include: |
| 162 | + - "docs/targets.md" |
| 163 | + - "docs/terraform.md" |
| 164 | + |
| 165 | +# Contributors to this project |
| 166 | +contributors: |
| 167 | + - name: "Erik Osterman" |
| 168 | + github: "osterman" |
| 169 | + - name: "Andriy Knysh" |
| 170 | + github: "aknysh" |
| 171 | + - name: "Igor Rodionov" |
| 172 | + github: "goruha" |
0 commit comments