# cluster name bohr resource "aws_cloudformation_stack" "workers" { name = "${module.cluster_label.id}-compute-workers" parameters = { NodeGroupName = "${module.cluster_label.id}-compute-workers" # Unique identifier for the Node Group. ClusterName = "${module.cluster_label.id}" ClusterControlPlaneSecurityGroup = "${aws_security_group.masters.id}" NodeImageId = "${data.aws_ami.worker.id}" NodeInstanceProfile = "${aws_iam_instance_profile.workers.arn}" UseExistingNodeSecurityGroups = "yes" ExistingNodeSecurityGroups = "${aws_security_group.workers.id}" VpcId = "${data.terraform_remote_state.shared.swat_staging_vpc_id}" KeyName = "${data.terraform_remote_state.staging.ec2_key_name}" Subnets = "${join(",",values(data.terraform_remote_state.staging.private_subnets_bohr))}" NodeAutoScalingGroupMinSize = "1" NodeAutoScalingGroupDesiredSize = "3" NodeAutoScalingGroupMaxSize = "9" ClusterAutoscalerStatus = "enabled" NodeInstanceType = "c5.2xlarge" ASGAutoAssignPublicIp = "no" OnDemandBaseCapacity = "1" OnDemandPercentageAboveBaseCapacity = "0" # (0-100) SpotInstancePools = "3" # (1-20) InstanceTypesOverride = "c5.2xlarge,m5.2xlarge,c4.2xlarge" # multiple spot instances to override (seperated by comma) BootstrapArgumentsForSpotFleet = "--kubelet-extra-args '--node-labels=lifecycle=Ec2Spot,node-role.kubernetes.io/spot-worker=true --register-with-taints=spotInstance=true:PreferNoSchedule'" BootstrapArgumentsForOnDemand = "--kubelet-extra-args '--node-labels=lifecycle=OnDemand,node-role.kubernetes.io/worker=true'" } template_url = "https://${aws_s3_bucket.templates.bucket_regional_domain_name}/${local.mixed_instances_template}" lifecycle { ignore_changes = [ "parameters.NodeAutoScalingGroupDesiredSize", ] } }