Initial commit.
This commit is contained in:
3
modules/eks-aws-load-balancer-controller/data.tf
Normal file
3
modules/eks-aws-load-balancer-controller/data.tf
Normal file
@ -0,0 +1,3 @@
|
||||
data "aws_eks_cluster_auth" "self" {
|
||||
name = var.cluster_id
|
||||
}
|
16
modules/eks-aws-load-balancer-controller/main.tf
Normal file
16
modules/eks-aws-load-balancer-controller/main.tf
Normal file
@ -0,0 +1,16 @@
|
||||
resource "helm_release" "aws_load_balancer_controller" {
|
||||
name = "aws-load-balancer-controller"
|
||||
repository = "https://aws.github.io/eks-charts"
|
||||
chart = "aws-load-balancer-controller"
|
||||
version = "1.4.2"
|
||||
namespace = var.namespace
|
||||
create_namespace = var.create_namespace
|
||||
|
||||
values = [
|
||||
templatefile("values.yaml", {
|
||||
cluster_name = var.cluster_id
|
||||
service_account_name = var.service_account_name
|
||||
iam_role_arn = var.iam_role_arn
|
||||
})
|
||||
]
|
||||
}
|
7
modules/eks-aws-load-balancer-controller/provider.tf
Normal file
7
modules/eks-aws-load-balancer-controller/provider.tf
Normal file
@ -0,0 +1,7 @@
|
||||
provider "helm" {
|
||||
kubernetes {
|
||||
host = var.cluster_endpoint
|
||||
cluster_ca_certificate = base64decode(var.cluster_certificate_authority_data)
|
||||
token = data.aws_eks_cluster_auth.self.token
|
||||
}
|
||||
}
|
8
modules/eks-aws-load-balancer-controller/values.yaml
Normal file
8
modules/eks-aws-load-balancer-controller/values.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
clusterName: "${cluster_name}"
|
||||
|
||||
serviceAccount:
|
||||
create: true
|
||||
annotations:
|
||||
eks.amazonaws.com/role-arn: "${iam_role_arn}"
|
||||
name: "${service_account_name}"
|
||||
automountServiceAccountToken: true
|
41
modules/eks-aws-load-balancer-controller/variables.tf
Normal file
41
modules/eks-aws-load-balancer-controller/variables.tf
Normal file
@ -0,0 +1,41 @@
|
||||
variable "environment" {
|
||||
description = "Environment name, used for secret naming convention"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "cluster_id" {
|
||||
type = string
|
||||
description = "The name/id of the EKS cluster. Will block on cluster creation until the cluster is really ready"
|
||||
}
|
||||
|
||||
variable "cluster_endpoint" {
|
||||
type = string
|
||||
description = "Endpoint for your Kubernetes API server"
|
||||
}
|
||||
|
||||
variable "cluster_certificate_authority_data" {
|
||||
type = string
|
||||
description = "Base64 encoded certificate data required to communicate with the cluster"
|
||||
}
|
||||
|
||||
variable "namespace" {
|
||||
type = string
|
||||
description = "The namespace where the helm chart is deployed"
|
||||
default = "aws-local-balancer"
|
||||
}
|
||||
|
||||
variable "create_namespace" {
|
||||
type = bool
|
||||
description = "Flag allowing to create the namespace if it does not exists"
|
||||
default = true
|
||||
}
|
||||
|
||||
variable "service_account_name" {
|
||||
type = string
|
||||
description = "The name of the service account used by the controller"
|
||||
}
|
||||
|
||||
variable "iam_role_arn" {
|
||||
type = string
|
||||
description = "The arn of the IAM Role that have permissions required by the controller"
|
||||
}
|
Reference in New Issue
Block a user