Skip to content

Commit

Permalink
Merge pull request #6 from Samseppiol/master
Browse files Browse the repository at this point in the history
Enable node scaling functionality with asg tags
  • Loading branch information
Guslington authored Apr 24, 2020
2 parents a7083e0 + 97cfcf4 commit b3d088b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion eks-cluster.cfhighlander.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
ComponentParam 'InstanceType'

ComponentParam 'SpotPrice', ''

ComponentParam 'EnableScaling', 'true'
ComponentParam 'DesiredCapacity', '1'
ComponentParam 'MinSize', '1'
ComponentParam 'MaxSize', '2'
Expand Down
7 changes: 7 additions & 0 deletions eks-cluster.cfndsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@
LaunchTemplateData(template_data)
}

asg_tags = [
{ Key: FnSub("k8s.io/cluster/${EksCluster}"), Value: 'owned' },
{ Key: 'k8s.io/cluster-autoscaler/enabled', Value: Ref('EnableScaling') }
]
asg_tags += tags
asg_tags.each {|tag| tag[:PropagateAtLaunch] = false }
AutoScaling_AutoScalingGroup(:EksNodeAutoScalingGroup) {
UpdatePolicy(:AutoScalingRollingUpdate, {
MaxBatchSize: '1',
Expand All @@ -193,6 +199,7 @@
LaunchTemplateId: Ref(:EksNodeLaunchTemplate),
Version: FnGetAtt(:EksNodeLaunchTemplate, :LatestVersionNumber)
})
Tags asg_tags
}


Expand Down

0 comments on commit b3d088b

Please sign in to comment.