Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tf_mod_aws_eks_cluster
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
steamhaus
tf_mod_aws_eks_cluster
Commits
61582a85
Commit
61582a85
authored
Sep 10, 2018
by
Chris Merrett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for cluster-autoscaler
parent
398489fd
Pipeline
#5377
passed with stage
in 16 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
data.tf
data.tf
+18
-0
workers.tf
workers.tf
+22
-0
No files found.
data.tf
View file @
61582a85
...
...
@@ -68,6 +68,24 @@ data "aws_iam_policy_document" "admin_assumerole" {
}
}
data
"aws_iam_policy_document"
"workers_autoscaling"
{
statement
{
effect
=
"Allow"
actions
=
[
"autoscaling:DescribeAutoScalingGroups"
,
"autoscaling:DescribeAutoScalingInstances"
,
"autoscaling:DescribeTags"
,
"autoscaling:SetDesiredCapacity"
,
"autoscaling:TerminateInstanceInAutoScalingGroup"
,
"autoscaling:DescribeLaunchConfigurations"
,
"ec2:DescribeLaunchTemplateVersions"
,
]
resources
=
[
"*"
]
}
}
data
"template_file"
"kubeconfig"
{
template
=
"
${
file
(
"
${
path
.
module}
/templates/kubeconfig.tpl"
)
}
"
...
...
workers.tf
View file @
61582a85
...
...
@@ -28,6 +28,18 @@ resource "aws_autoscaling_group" "workers" {
value
=
"owned"
propagate_at_launch
=
true
}
tag
{
key
=
"k8s.io/cluster-autoscaler/enabled"
value
=
"true"
propagate_at_launch
=
true
}
tag
{
key
=
"k8s.io/cluster-autoscaler/
${
var
.
cluster_name
}
"
value
=
""
propagate_at_launch
=
true
}
}
resource
"aws_security_group"
"workers"
{
...
...
@@ -95,3 +107,13 @@ resource "aws_iam_instance_profile" "workers" {
name
=
"
${
var
.
cluster_name
}
-eks-workers-instance-profile"
role
=
"
${
aws_iam_role
.
workers
.
name
}
"
}
resource
"aws_iam_policy"
"workers_autoscaling"
{
name
=
"
${
var
.
cluster_name
}
-eks-kubernetes-workers-autoscaling"
policy
=
"
${data
.
aws_iam_policy_document
.
workers_autoscaling
.
json
}
"
}
resource
"aws_iam_role_policy_attachment"
"workers_autoscaling"
{
role
=
"
${
aws_iam_role
.
workers
.
name
}
"
policy_arn
=
"
${
aws_iam_policy
.
workers_autoscaling
.
arn
}
"
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment