-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement ingress-nginx helm release as module
- Loading branch information
1 parent
d03380d
commit a9463fa
Showing
6 changed files
with
92 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module "eks_addons" { | ||
source = "./modules/eks_addons" | ||
enable_ingress_nginx = var.ingress_nginx_config.enable | ||
|
||
ingress_nginx_helm_config = { | ||
namespace = "nginx" | ||
name = "ingress-nginx" | ||
chart = "ingress-nginx" | ||
repository = var.ingress_nginx_config.helm_repository | ||
version = var.ingress_nginx_config.helm_version | ||
description = "The NGINX HelmChart Ingress Controller deployment configuration" | ||
create_namespace = true | ||
dependency_update = true | ||
values = [ | ||
templatefile("${path.module}/templates/nginx_values.yaml", { | ||
public_subnets = join(", ", local.public_subnets) | ||
}), | ||
yamlencode(var.ingress_nginx_config.chart_values) | ||
] | ||
} | ||
|
||
depends_on = [module.eks.eks_cluster_arn] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
resource "kubernetes_namespace_v1" "ingress_nginx" { | ||
count = try(var.ingress_nginx_helm_config.create_namespace, true) && var.ingress_nginx_helm_config.namespace != "kube-system" && var.enable_ingress_nginx ? 1 : 0 | ||
|
||
metadata { | ||
name = var.ingress_nginx_helm_config.namespace | ||
} | ||
} | ||
|
||
resource "helm_release" "ingress_nginx" { | ||
count = var.enable_ingress_nginx ? 1 : 0 | ||
|
||
namespace = var.ingress_nginx_helm_config.namespace | ||
name = var.ingress_nginx_helm_config.name | ||
chart = var.ingress_nginx_helm_config.chart | ||
repository = var.ingress_nginx_helm_config.repository | ||
version = var.ingress_nginx_helm_config.version | ||
description = var.ingress_nginx_helm_config.description | ||
create_namespace = var.ingress_nginx_helm_config.create_namespace | ||
dependency_update = var.ingress_nginx_helm_config.dependency_update | ||
values = var.ingress_nginx_helm_config.values | ||
timeout = 1200 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
variable "enable_ingress_nginx" { | ||
description = "Enable Ingress Nginx helm release creation" | ||
type = bool | ||
default = false | ||
} | ||
|
||
variable "ingress_nginx_helm_config" { | ||
description = "Helm Configuration for Ingress Nginx" | ||
type = object({ | ||
namespace = string | ||
name = string | ||
chart = string | ||
repository = string | ||
version = string | ||
description = string | ||
create_namespace = bool | ||
dependency_update = bool | ||
values = list(string) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters