Initial commit.

This commit is contained in:
Patrick MARIE
2022-07-01 14:12:11 +02:00
commit 188cf2679c
58 changed files with 1837 additions and 0 deletions

View File

@ -0,0 +1,3 @@
data "aws_eks_cluster_auth" "self" {
name = var.cluster_id
}

View 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
})
]
}

View 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
}
}

View 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

View 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"
}