Skip to content

Commit

Permalink
feat: add gpu support
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiFleKs committed Apr 16, 2019
1 parent 0ec79a8 commit 97625f8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion terraform/modules/eks/eks-worker-nodes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ data "aws_ami" "eks-worker" {
owners = ["602401143452"] # Amazon EKS AMI Account ID
}

data "aws_ami" "eks-gpu-worker" {
filter {
name = "name"
values = ["amazon-eks-gpu-node-${var.kubernetes_version}*"]
}

most_recent = true
owners = ["602401143452"] # Amazon EKS AMI Account ID
}

data "template_file" "eks-node" {
count = "${length(var.node-pools)}"
template = "${file("templates/eks-node.tpl")}"
Expand All @@ -27,7 +37,7 @@ resource "aws_launch_template" "eks" {
name = "${aws_iam_instance_profile.eks-node.*.name[count.index]}"
}

image_id = "${data.aws_ami.eks-worker.id}"
image_id = "${lookup(var.node-pools[count.index], "image_id", lookup(var.node-pools[count.index], "gpu_ami", "false" ) ? data.aws_ami.eks-gpu-worker.id : data.aws_ami.eks-worker.id)}"
instance_type = "${lookup(var.node-pools[count.index],"instance_type")}"
name_prefix = "terraform-eks-${var.cluster-name}-node-pool-${lookup(var.node-pools[count.index],"name")}"
vpc_security_group_ids = ["${aws_security_group.eks-node.id}"]
Expand Down
2 changes: 1 addition & 1 deletion terraform/modules/eks/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ variable "use_route53" {

variable "kubernetes_version" {
description = "EKS version"
default = "1.11"
default = "1.12"
}

variable "external_dns" {
Expand Down

0 comments on commit 97625f8

Please sign in to comment.