diff --git a/README.md b/README.md index af2498b..e481f02 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ module "nginx-controller" { | name | Name of created helm release | `string` | `ingress-nginx` | no | | namespace\_name | Name of namespace where nginx controller should be deployed | `string` | `kube-system` | no | | chart\_version | HELM Chart Version for controller ( It is not recommended to change )| `string` | `4.0.6` | no | +| atomic | If set, installation process purges chart on fail | `bool` | `false` | no | | ingress\_class\_name | IngressClass resource name | `string` | `nginx` | no | | ingress\_class\_is_default | IngressClass resource default for cluster | `bool` | `true` | no | | ip_address | External Static Address for loadbalancer (Doesn't work with AWS) | `string` | n/a | no | @@ -80,4 +81,4 @@ module "nginx-controller" { | terraform | >= 0.13.0 | | helm | >= 2.1.0 | -## Kubernetes version: `>=1.19` \ No newline at end of file +## Kubernetes version: `>=1.19` diff --git a/locals.tf b/locals.tf index 7073cc6..f2c7dd8 100644 --- a/locals.tf +++ b/locals.tf @@ -1,6 +1,6 @@ locals { - helm_chart = "ingress-nginx" - helm_repository = "https://kubernetes.github.io/ingress-nginx" + helm_chart = "ingress-nginx" + helm_repository = "https://kubernetes.github.io/ingress-nginx" loadBalancerIP = var.ip_address == null ? [] : [ { diff --git a/main.tf b/main.tf index bbedac3..9c1a3a7 100644 --- a/main.tf +++ b/main.tf @@ -4,6 +4,7 @@ resource "helm_release" "application" { namespace = var.namespace repository = local.helm_repository version = var.chart_version + atomic = var.atomic values = [var.disable_heavyweight_metrics ? file("${path.module}/templates/metrics-disable.yaml") : ""] @@ -11,7 +12,7 @@ resource "helm_release" "application" { name = "controller.kind" value = var.controller_kind } - set { + set { name = "controller.ingressClassResource.name" value = var.ingress_class_name } @@ -69,4 +70,4 @@ resource "helm_release" "application" { type = lookup(set.value, "type", null) } } -} \ No newline at end of file +} diff --git a/variables.tf b/variables.tf index dc92960..52458e5 100644 --- a/variables.tf +++ b/variables.tf @@ -15,6 +15,12 @@ variable "chart_version" { default = "4.0.6" } +variable "atomic" { + type = bool + description = "If set, installation process purges chart on fail" + default = false +} + variable "ingress_class_name" { type = string description = "IngressClass resource name" @@ -90,4 +96,4 @@ variable "disable_heavyweight_metrics" { variable "additional_set" { description = "Add additional set for helm" default = [] -} \ No newline at end of file +}