Skip to content

Commit

Permalink
Merge pull request #31 from sighupio/bugfix/fix-history
Browse files Browse the repository at this point in the history
[CHORE] - Align master-no-spot-instance with master branch
  • Loading branch information
nutellinoit authored Mar 30, 2022
2 parents ff9c457 + 94badd5 commit 9aab089
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Fury EKS Installer
</h1>

![Release](https://img.shields.io/github/v/release/sighupio/fury-eks-installer?label=Latest%20Release)
![Release](https://img.shields.io/badge/Latest%20Release-v1.9.0-blue)
![License](https://img.shields.io/github/license/sighupio/fury-eks-installer?label=License)
[![Slack](https://img.shields.io/badge/slack-@kubernetes/fury-yellow.svg?logo=slack&label=Slack)](https://kubernetes.slack.com/archives/C0154HYTAQH)

Expand Down
40 changes: 36 additions & 4 deletions example/eks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module "my-cluster" {
source = "../../modules/eks"

cluster_name = "my-cluster"
cluster_version = "1.14"
cluster_version = "1.20"

network = "vpc-id0"
subnetworks = [
Expand All @@ -25,7 +25,6 @@ module "my-cluster" {
min_size : 1
max_size : 2
instance_type : "m5.large"
spot_instance : true
volume_size : 100
subnetworks : null
eks_target_group_arns : null
Expand All @@ -38,13 +37,46 @@ module "my-cluster" {
ports : "80-80"
tags : {
"hello" : "tag",
"cluster-tags" : "my-value-OVERRIDE"
"cluster-tags" : "my-value-OVERRIDE-1"
}
}
]
labels : {
"node.kubernetes.io/role" : "app"
"sighup.io/fury-release" : "v1.23.0"
"sighup.io/fury-release" : "v1.23.1"
}
taints : []
tags : {
"node-tags" : "exists"
}
# max_pods : null # To use default EKS setting set it to null or do not set it
},{
name : "m5-node-pool-spot"
version : null # To use same value as cluster_version
min_size : 1
max_size : 2
instance_type : "m5.large"
spot_instance : true # optionally create spot instances
os : "ami-0caf35bc73450c396" # optionally define a custom AMI
volume_size : 100
subnetworks : null
eks_target_group_arns : null
additional_firewall_rules : [
{
name : "Debug 2"
direction : "ingress"
cidr_block : "0.0.0.0/0"
protocol : "TCP"
ports : "80-80"
tags : {
"hello" : "tag",
"cluster-tags" : "my-value-OVERRIDE-2"
}
}
]
labels : {
"node.kubernetes.io/role" : "app"
"sighup.io/fury-release" : "v1.23.1"
}
taints : []
tags : {
Expand Down
41 changes: 36 additions & 5 deletions modules/eks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module "my-cluster" {
source = "../../modules/eks"
cluster_name = "my-cluster"
cluster_version = "1.14"
cluster_version = "1.20"
network = "vpc-id0"
subnetworks = [
Expand All @@ -77,7 +77,6 @@ module "my-cluster" {
min_size : 1
max_size : 2
instance_type : "m5.large"
spot_instance : true
volume_size : 100
subnetworks : null
eks_target_group_arns : null
Expand All @@ -90,19 +89,51 @@ module "my-cluster" {
ports : "80-80"
tags : {
"hello" : "tag",
"cluster-tags" : "my-value-OVERRIDE"
"cluster-tags" : "my-value-OVERRIDE-1"
}
}
]
labels : {
"node.kubernetes.io/role" : "app"
"sighup.io/fury-release" : "v1.23.0"
"sighup.io/fury-release" : "v1.23.1"
}
taints : []
tags : {
"node-tags" : "exists"
}
},
{
name : "m5-node-pool-spot"
version : null # To use same value as cluster_version
min_size : 1
max_size : 2
instance_type : "m5.large"
spot_instance : true # optionally create spot instances
os : "ami-0caf35bc73450c396" # optionally define a custom AMI
volume_size : 100
subnetworks : null
eks_target_group_arns : null
additional_firewall_rules : [
{
name : "Debug 2"
direction : "ingress"
cidr_block : "0.0.0.0/0"
protocol : "TCP"
ports : "80-80"
tags : {
"hello" : "tag",
"cluster-tags" : "my-value-OVERRIDE-2"
}
}
]
labels : {
"node.kubernetes.io/role" : "app"
"sighup.io/fury-release" : "v1.23.1"
}
taints : []
tags : {
"node-tags" : "exists"
}
# max_pods : null # To use default EKS setting set it to null or do not set it
},
]
Expand Down
8 changes: 2 additions & 6 deletions modules/eks/eks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ locals {
"k8s.io/cluster-autoscaler/enabled" : "true"
}


parsed_node_pools = [
for worker in var.node_pools :
{
"name" : worker.name,
"ami_id" : element(data.aws_ami.eks_worker.*.image_id, index(var.node_pools.*.name, worker.name)),
"os" : worker.os != null ? worker.os : element(data.aws_ami.eks_worker.*.image_id, index(var.node_pools.*.name, worker.name)),
"security_group_id" : element(aws_security_group.node_pool.*.id, index(var.node_pools.*.name, worker.name)),
"min_size" : worker.min_size,
"max_size" : worker.max_size,
Expand All @@ -30,9 +29,6 @@ EOT
]
}




module "cluster" {
source = "terraform-aws-modules/eks/aws"
version = "16.2.0"
Expand Down Expand Up @@ -64,7 +60,7 @@ module "cluster" {
for node_pool in local.parsed_node_pools :
{
name = lookup(node_pool, "name")
ami_id = lookup(node_pool, "ami_id")
ami_id = lookup(node_pool, "os")
asg_desired_capacity = lookup(node_pool, "min_size")
asg_max_size = lookup(node_pool, "max_size")
asg_min_size = lookup(node_pool, "min_size")
Expand Down
5 changes: 3 additions & 2 deletions modules/eks/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@ variable "node_pools" {
min_size = number
max_size = number
instance_type = string
spot_instance = bool
os = optional(string)
spot_instance = optional(bool)
max_pods = optional(number) # null to use default upstream configuration
volume_size = number
subnetworks = list(string) # null to use default upstream configuration
labels = map(string)
taints = list(string)
tags = map(string)
eks_target_group_arns = list(string)
eks_target_group_arns = optional(list(string))
additional_firewall_rules = list(object({
name = string
direction = string
Expand Down

0 comments on commit 9aab089

Please sign in to comment.