Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 22 additions & 9 deletions terraform/layer2-k8s/eks-aws-loadbalancer-controller.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,29 @@ locals {
enabled = local.helm_releases[index(local.helm_releases.*.id, "aws-load-balancer-controller")].enabled
chart = local.helm_releases[index(local.helm_releases.*.id, "aws-load-balancer-controller")].chart
repository = local.helm_releases[index(local.helm_releases.*.id, "aws-load-balancer-controller")].repository
chart_version = local.helm_releases[index(local.helm_releases.*.id, "aws-load-balancer-controller")].version
chart_version = local.helm_releases[index(local.helm_releases.*.id, "aws-load-balancer-controller")].chart_version
namespace = local.helm_releases[index(local.helm_releases.*.id, "aws-load-balancer-controller")].namespace
}
alb_ingress_controller = templatefile("${path.module}/templates/alb-ingress-controller-values.yaml",
{
role_arn = local.aws_load_balancer_controller.enabled ? module.aws_iam_aws_loadbalancer_controller[0].role_arn : "",
region = local.region,
cluster_name = local.eks_cluster_id,
vpc_id = local.vpc_id
})
aws_load_balancer_controller_values = <<VALUES
clusterName: ${local.eks_cluster_id}
region: ${local.region}
vpcId: ${local.eks_cluster_id}

serviceAccount:
create: true
annotations:
"eks.amazonaws.com/role-arn": ${local.aws_load_balancer_controller.enabled ? module.aws_iam_aws_loadbalancer_controller[0].role_arn : ""}

affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: eks.amazonaws.com/capacityType
operator: In
values:
- ON_DEMAND
VALUES
}

#tfsec:ignore:kubernetes-network-no-public-egress tfsec:ignore:kubernetes-network-no-public-ingress
Expand Down Expand Up @@ -318,7 +331,7 @@ resource "helm_release" "aws_loadbalancer_controller" {
max_history = var.helm_release_history_size

values = [
local.alb_ingress_controller
local.aws_load_balancer_controller_values
]

}
2 changes: 1 addition & 1 deletion terraform/layer2-k8s/helm-releases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ releases:
enabled: false
chart: aws-load-balancer-controller
repository: https://aws.github.io/eks-charts
version: 1.2.6
chart_version: 1.2.6
namespace: aws-load-balancer-controller
- id: aws-node-termination-handler
enabled: true
Expand Down
19 changes: 0 additions & 19 deletions terraform/layer2-k8s/templates/alb-ingress-controller-values.yaml

This file was deleted.