From f79c79015320b3089a82ce0d83fb625472c801c1 Mon Sep 17 00:00:00 2001 From: Roman Voitenko Date: Mon, 23 Sep 2019 17:50:01 +0200 Subject: [PATCH] Gpu workers support (#515) * added posibility to use Amazon EKS-Optimized AMI with GPU Support for workers * updated CHANGELOG.md * added missing var prefix * updated Changelog to ver 6.x.x --- CHANGELOG.md | 2 +- README.md | 3 ++- data.tf | 2 +- variables.tf | 6 ++++++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 07605e4..8c298d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ project adheres to [Semantic Versioning](http://semver.org/). ### Added -- Write your awesome addition here (by @you) + - Added support for different workers AMI's, i.e. with GPU support (by @rvoitenko) ### Changed diff --git a/README.md b/README.md index c35e307..3a607f8 100644 --- a/README.md +++ b/README.md @@ -139,7 +139,8 @@ MIT Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-a | tags | A map of tags to add to all resources. | map(string) | `{}` | no | | vpc\_id | VPC where the cluster and workers will be deployed. | string | n/a | yes | | worker\_additional\_security\_group\_ids | A list of additional security group ids to attach to worker instances | list(string) | `[]` | no | -| worker\_ami\_name\_filter | Additional name filter for AWS EKS worker AMI. Default behaviour will get latest for the cluster_version but could be set to a release from amazon-eks-ami, e.g. "v20190220" | string | `"v*"` | no | +| worker\_ami\_name\_filter | Additional name filter for AWS EKS worker AMI. Default behaviour will get latest for the cluster\_version but could be set to a release from amazon-eks-ami, e.g. "v20190220" | string | `"v*"` | no | +| worker\_ami\_name\_filter\_prefix | Name prefix filter for AWS EKS worker AMI. Default behaviour will get regular EKS-Optimized AMI but could be set to a EKS-Optimized AMI with GPU Support, e.g. "amazon-eks-gpu-node", or custom AMI | string | `"amazon-eks-node"` | no | | worker\_create\_security\_group | Whether to create a security group for the workers or attach the workers to `worker_security_group_id`. | bool | `"true"` | no | | worker\_groups | A list of maps defining worker group configurations to be defined using AWS Launch Configurations. See workers_group_defaults for valid keys. | any | `[]` | no | | worker\_groups\_launch\_template | A list of maps defining worker group configurations to be defined using AWS Launch Templates. See workers_group_defaults for valid keys. | any | `[]` | no | diff --git a/data.tf b/data.tf index c1f92ca..3a5ae4f 100644 --- a/data.tf +++ b/data.tf @@ -19,7 +19,7 @@ data "aws_iam_policy_document" "workers_assume_role_policy" { data "aws_ami" "eks_worker" { filter { name = "name" - values = ["amazon-eks-node-${var.cluster_version}-${var.worker_ami_name_filter}"] + values = ["${var.worker_ami_name_filter_prefix}-${var.cluster_version}-${var.worker_ami_name_filter}"] } most_recent = true diff --git a/variables.tf b/variables.tf index d1a1f71..47d49e7 100644 --- a/variables.tf +++ b/variables.tf @@ -126,6 +126,12 @@ variable "worker_ami_name_filter" { default = "v*" } +variable "worker_ami_name_filter_prefix" { + description = "Name prefix filter for AWS EKS worker AMI. Default behaviour will get regular EKS-Optimized AMI but could be set to a EKS-Optimized AMI with GPU Support, e.g. \"amazon-eks-gpu-node\", or custom AMI" + type = string + default = "amazon-eks-node" +} + variable "worker_additional_security_group_ids" { description = "A list of additional security group ids to attach to worker instances" type = list(string)