mirror of
https://github.com/terraform-aws-modules/terraform-aws-eks.git
synced 2025-09-09 19:32:58 +08:00
da2c78b8ba
* run terraform upgrade tool * fix post upgrade TODOs * use strict typing for variables * upgrade examples, point them at VPC module tf 0.12 PR * remove unnecessary `coalesce()` calls coalesce(lookup(map, key, ""), default) -> lookup(map, key, default) * Fix autoscaling_enabled broken (#1) * always set a value for tags, fix coalescelist calls * always set a value for these tags * fix tag value * fix tag value * default element available * added default value * added a general default without this default - TF is throwing an error when running a destroy * Fix CI * Change vpc module back to `terraform-aws-modules/vpc/aws` in example * Update CHANGELOG.md * Change type of variable `cluster_log_retention_in_days` to number * Remove `xx_count` variables * Actual lists instead of strings with commas * Remove `xx_count` variable from docs * Replace element with list indexing * Change variable `worker_group_tags` to a attribute of worker_group * Fix workers_launch_template_mixed tags * Change override_instance_type_x variables to list. * Update CHANGELOG.md
59 lines
1.4 KiB
Terraform
59 lines
1.4 KiB
Terraform
terraform {
|
|
required_version = ">= 0.12.0"
|
|
}
|
|
|
|
provider "aws" {
|
|
version = ">= 2.11"
|
|
region = var.region
|
|
}
|
|
|
|
provider "random" {
|
|
version = "~> 2.1"
|
|
}
|
|
|
|
data "aws_availability_zones" "available" {
|
|
}
|
|
|
|
locals {
|
|
cluster_name = "test-eks-spot-${random_string.suffix.result}"
|
|
}
|
|
|
|
resource "random_string" "suffix" {
|
|
length = 8
|
|
special = false
|
|
}
|
|
|
|
module "vpc" {
|
|
source = "terraform-aws-modules/vpc/aws"
|
|
version = "2.6.0"
|
|
|
|
name = "test-vpc-spot"
|
|
cidr = "10.0.0.0/16"
|
|
azs = data.aws_availability_zones.available.names
|
|
public_subnets = ["10.0.4.0/24", "10.0.5.0/24", "10.0.6.0/24"]
|
|
|
|
tags = {
|
|
"kubernetes.io/cluster/${local.cluster_name}" = "shared"
|
|
}
|
|
}
|
|
|
|
module "eks" {
|
|
source = "../.."
|
|
cluster_name = local.cluster_name
|
|
subnets = module.vpc.public_subnets
|
|
vpc_id = module.vpc.vpc_id
|
|
|
|
worker_groups_launch_template_mixed = [
|
|
{
|
|
name = "spot-1"
|
|
override_instance_types = ["m5.large", "c5.large", "t3.large", "r5.large"]
|
|
spot_instance_pools = 4
|
|
asg_max_size = 5
|
|
asg_desired_capacity = 5
|
|
kubelet_extra_args = "--node-labels=kubernetes.io/lifecycle=spot"
|
|
public_ip = true
|
|
},
|
|
]
|
|
}
|
|
|