Skip to content

fmlisco/terraform-aws-alb-ingress-controller

 
 

Repository files navigation

Terraform module: AWS ALB Ingress Controller

This Terraform module can be used to install the AWS ALB Ingress Controller into a Kubernetes cluster.

IMPORTANT WARNING: considering that the kubernetes provider, in order to run the plan and apply, must be able to access the cluster api, it is not possible to insert the module within the same file and / or terraform configuration that creates the EKS cluster as it is not the cluster would exist.

For this reason, I recommend separating the terraform configurations and launching the one containing this module and other modules like this one at a later time. HERE THE ISSUE DIRECTLY FROM KUBERNETES PROVIDER

Examples

EKS Basic Deployment

To deploy the AWS ALB Ingress Controller into an EKS cluster.

module "alb_controller" {
  source  = "campaand/alb-controller/aws"
  version = "~> 1.0"

  cluster_name = var.cluster_name
  vpc_id       = module.vpc.vpc_id
}

EKS Deployment with Different Namespace

To deploy the AWS ALB Ingress Controller into an EKS cluster using different custom namespace, if not exist, the namespace will be created.

module "alb_controller" {
  source  = "campaand/alb-controller/aws"
  version = "~> 1.0"

  namespace    = "your-custom-namespace"
  cluster_name = var.cluster_name
  vpc_id       = module.vpc.vpc_id
}

EKS Deployment with Different Helm Settings

To deploy the AWS ALB Ingress Controller into an EKS cluster using different helm parameters based on Helm Chart Values.

If you need to insert custom annotations for Ingresses and Services, consult ALB Controller Annotations.

Helm Values already setted:

default_helm_values = {
  "image.repository" = "docker.io/amazon/aws-alb-ingress-controller", 
  "clusterName" = "${var.cluster_name}",
  "serviceAccount.create" = "false",
  "serviceAccount.name" = "${var.service_account_name}"
}

You can add or overwrite this values using the settings variable, if you add a value with the same key, you overwrote the default one.

module "alb_controller" {
  source  = "campaand/alb-controller/aws"
  version = "~> 1.0"

  cluster_name = var.cluster_name
  vpc_id       = module.vpc.vpc_id
  
  helm_chart_version = "1.4.6"

  settings = {
      key1 = value1,
      key2 = value2,
      key3 = value3,
      key4 = value4
  }
}

Test your infrastructure

https://docs.aws.amazon.com/eks/latest/userguide/alb-ingress.html#application-load-balancer-sample-application

About

Terraform module to ease deployment of the AWS ALB Ingress Controller, based on best practices.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HCL 100.0%