workers can now be specified as multiple asgs of different flavors. BYO security group now possible for both workers and cluster

This commit is contained in:
brandoconnor
2018-06-11 03:34:13 -07:00
parent 1b928930a8
commit 6bda7ee97d
15 changed files with 359 additions and 458 deletions

View File

@@ -1,19 +1,14 @@
variable "additional_userdata" {
description = "Extra lines of userdata (bash) which are appended to the default userdata code."
variable "cluster_name" {
description = "Name of the EKS cluster. Also used as a prefix in names of related resources."
}
variable "cluster_security_group_id" {
description = "If provided, the EKS cluster will be attached to this security group. If not given, a security group will be created with necessary ingres/egress to work with the workers and provide API access to your current IP/32."
default = ""
}
variable "cluster_ingress_cidrs" {
description = "The CIDRs from which we can execute kubectl commands."
type = "list"
}
variable "cluster_name" {
description = "Name of the EKS cluster which is also used as a prefix in names of related resources."
}
variable "cluster_version" {
description = "Kubernetes version to use for the cluster."
description = "Kubernetes version to use for the EKS cluster."
default = "1.10"
}
@@ -23,17 +18,12 @@ variable "config_output_path" {
}
variable "configure_kubectl_session" {
description = "Configure the current session's kubectl to use the instantiated cluster."
default = false
}
variable "ebs_optimized_workers" {
description = "If left at default of true, will use ebs optimization if available on the given instance type."
description = "Configure the current session's kubectl to use the instantiated EKS cluster."
default = true
}
variable "subnets" {
description = "A list of subnets to associate with the cluster's underlying instances."
description = "A list of subnets to place the EKS cluster and workers within."
type = "list"
}
@@ -43,21 +33,35 @@ variable "tags" {
}
variable "vpc_id" {
description = "VPC id where the cluster and other resources will be deployed."
description = "VPC where the cluster and workers will be deployed."
}
variable "worker_groups" {
description = "A list of maps defining worker group configurations."
description = "A list of maps defining worker group configurations. See workers_group_defaults for valid keys."
type = "list"
default = [
{
name = "nodes" # Name of the worker group.
ami_id = "" # AMI ID for the eks workers. If none is provided, Terraform will search for the latest version of their EKS optimized worker AMI.
asg_desired_capacity = "1" # Desired worker capacity in the autoscaling group.
asg_max_size = "3" # Maximum worker capacity in the autoscaling group.
asg_min_size = "1" # Minimum worker capacity in the autoscaling group.
instance_type = "m4.large" # Size of the workers instances.
},
]
default = [{
"name" = "default"
}]
}
variable "workers_group_defaults" {
description = "Default values for target groups as defined by the list of maps."
type = "map"
default = {
name = "count.index" # Name of the worker group. Literal count.index will never be used but if name is not set, the count.index interpolation will be used.
ami_id = "" # AMI ID for the eks workers. If none is provided, Terraform will search for the latest version of their EKS optimized worker AMI.
asg_desired_capacity = "1" # Desired worker capacity in the autoscaling group.
asg_max_size = "3" # Maximum worker capacity in the autoscaling group.
asg_min_size = "1" # Minimum worker capacity in the autoscaling group.
instance_type = "m4.large" # Size of the workers instances.
additional_userdata = "" # userdata to append to the default userdata.
ebs_optimized = true # sets whether to use ebs optimization on supported types.
}
}
variable "worker_security_group_id" {
description = "If provided, all workers will be attached to this security group. If not given, a security group will be created with necessary ingres/egress to work with the EKS cluster."
default = ""
}