Following @jordanm advise I searched high and low for documentation and finally came across something similar at https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/spot_instance_request https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/docs/spot-instances.md
and found this syntax in a related terraform configuration
spot_price = "1.10"
here is how it looks inside the EKS module:
module "eks" {
source = "terraform-aws-modules/eks/aws"
cluster_name = local.cluster_name
cluster_version = var.kube_version
subnets = module.vpc.private_subnets
vpc_id = module.vpc.vpc_id
enable_irsa = true
tags = {
Environment = "training"
GithubRepo = "terraform-aws-eks"
GithubOrg = "terraform-aws-modules"
}
worker_groups = [
{
name = "worker-group-bot"
instance_type = var.bot_instance
disk_size = var.bot_disk_size
additional_userdata = "echo foo bar"
additional_security_group_ids = [aws_security_group.worker_group_mgmt_two.id]
asg_desired_capacity = var.bot_desired
asg_max_size = var.bot_max
// availability_zones = [var.availability_zone]
// subnets = [module.vpc.private_subnets[0]]
kubelet_extra_args = "--node-labels=node.kubernetes.io/lifecycle=spot,prefer=bot"
suspended_processes = ["AZRebalance"]
spot_price = "1.10"
tags = [
{
"key" = "k8s.io/cluster-autoscaler/enabled"
"propagate_at_launch" = "false"
"value" = "true"
},
{
"key" = "k8s.io/cluster-autoscaler/${local.cluster_name}"
"propagate_at_launch" = "false"
"value" = "true"
}
]
},
]
workers_additional_policies = ["arn:aws:iam::aws:policy/AutoScalingFullAccess"]
}
If someone knows where the documentation resides please comment.
Answer from Rubber Duck on Stack OverflowMiddleware Inventory
middlewareinventory.com › blog › terraform-eks-spot-instances
Creating EKS Cluster with SPOT instances - Terraform | Devops Junction
April 3, 2022 - How to create EKS Cluster with SPOT instances using Terraform. Terraform EKS SPOT instances example code. How to create EKS Cluster with SPOT instances and labels.
Stack Overflow
stackoverflow.com › questions › 61602324 › terraform-aws-eks-worker-node-spot-instance
amazon eks - Terraform aws eks worker node spot instance - Stack Overflow
You can set two pools, for example, one for on-demond (1 - x), one for spot instances (0 - 20), so it will always have at least one on-demond instance running. 2020-05-05T02:26:53.167Z+00:00 ... ,how do i set two pools , the Terraform docs just shows how to set up eithier spot inst or on demand , but not both , can you share skeleton code ..
Terraform Registry
registry.terraform.io › modules › Young-ook › eks › aws › latest › examples › spot
Young-ook/eks/aws | spot Example - Terraform Registry
Registry · Please enable Javascript to use this application
Ec2spotworkshops
ec2spotworkshops.com › using_ec2_spot_instances_with_eks › 040_eksmanagednodegroupswithspot › workers_terraform.html
Create EKS managed node groups with Spot capacity :: EC2 Spot Workshops
First node group has xlarge (4 ... 2 and desired_size 1. The configuration capacity_type = “SPOT” indicates that the node group being created is an EKS managed node group with Spot capacity....
Ronamosa
ronamosa.io › eks with spot instances using terraform
EKS with Spot Instances using Terraform | The Uncommon Engineer
If you have the "best practice" setup of having each component/section of your infrastructure layout in separate folders e.g. eks in one folder, vpc in another -- and they have their own state files, which means they can't just reference each other. The solution is using terraform_remote_state data source.
Terraform Registry
registry.terraform.io › modules › Young-ook › eks › aws › 1.4.6 › examples › spot
Terraform Registry
Registry · Please enable Javascript to use this application
GitHub
github.com › terraform-aws-modules › terraform-aws-eks › issues › 1180
Spot instances are not joined to a fresh eks 1.18.9 cluster. · Issue #1180 · terraform-aws-modules/terraform-aws-eks
AutoScalingGroups: - AutoScalingGroupARN: arn:aws:autoscaling:us-west-2:xxx:autoScalingGroup:ba201f3a-7f31-46e1-9ae0-d3f79e88cad2:autoScalingGroupName/team-shared-eks-python-spot-pool20210109234259660100000003 AutoScalingGroupName: team-shared-eks-python-spot-pool20210109234259660100000003 AvailabilityZones: - us-west-2a - us-west-2b - us-west-2c CreatedTime: '2021-01-09T23:43:01.090000+00:00' DefaultCooldown: 300 DesiredCapacity: 2 EnabledMetrics: [] HealthCheckGracePeriod: 300 HealthCheckType: EC2 Instances: - AvailabilityZone: us-west-2a HealthStatus: Healthy InstanceId: i-0ba3f2a68d9ac97ca
Published Jan 10, 2021
Author dmitry-mightydevops
Terraform Registry
registry.terraform.io › modules › dasmeta › complete-eks-cluster › aws › latest › examples › spot-instance
spot-instance - dasmeta/complete-eks-cluster/aws
Registry · Please enable Javascript to use this application
GitHub
github.com › AKSarav › TerraformEKS-SPOT
GitHub - AKSarav/TerraformEKS-SPOT: Terraform EKS Creation with SPOT instances
Terraform EKS Creation with SPOT instances. Contribute to AKSarav/TerraformEKS-SPOT development by creating an account on GitHub.
Starred by 3 users
Forked by 15 users
Languages HCL
Terraform Registry
registry.terraform.io › modules › dasmeta › eks › aws › latest › examples › spot-instance
spot-instance - dasmeta/eks/aws
Registry · Please enable Javascript to use this application
Terraform Registry
registry.terraform.io › modules › howdio › eks › aws › latest › examples › advanced
howdio/eks/aws | advanced Example - Terraform Registry
Registry · Please enable Javascript to use this application
GitHub
github.com › spotinst › terraform-spotinst-ocean-eks
GitHub - spotinst/terraform-spotinst-ocean-eks: [Deprecated] A Terraform module to create an Amazon Elastic Kubernetes Service (EKS) cluster with Ocean.
Starred by 22 users
Forked by 30 users
Languages HCL 99.5% | Makefile 0.5%
Terraform Registry
registry.terraform.io › modules › quortex › eks-cluster › aws › latest
quortex/eks-cluster/aws | Terraform Registry
Registry · Please enable Javascript to use this application
Ec2spotworkshops
ec2spotworkshops.com › amazon-ec2-spot-cicd-workshop › gitlab-spot › 050-deploying-eks-on-spot.html
Deploying Amazon EKS on Spot instances :: EC2 Spot Workshops
Switch to the directory with IaC templates, initialize the Terraform working directory, and apply the changes: cd ~/environment/amazon-ec2-spot-cicd-workshop/gitlab-spot/eks-cluster terraform init TOKEN=$(curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 600") export TF_VAR_aws_region=$(curl -s -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/placement/region) curl -o iam-policy.json https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/main/docs/install/iam_policy.json export TF_VAR_alb_poli