diff --git a/CHANGELOG.md b/CHANGELOG.md index 081b8b2..022755f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,14 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [0.5.1] - 2024-05-13 + +[Compare with previous version](https://github.com/sparkfabrik/terraform-helm-ingress-nginx/compare/0.5.0...0.5.1) + +### Changed + +- Fix `podAntiAffinity` configuration. + ## [0.5.0] - 2024-05-13 [Compare with previous version](https://github.com/sparkfabrik/terraform-helm-ingress-nginx/compare/0.4.0...0.5.0) diff --git a/files/values.yaml.tftpl b/files/values.yaml.tftpl index 0ac971a..1f53344 100644 --- a/files/values.yaml.tftpl +++ b/files/values.yaml.tftpl @@ -43,11 +43,11 @@ controller: - key: app.kubernetes.io/name operator: In values: - - ingress-nginx + - ${chart_name} - key: app.kubernetes.io/instance operator: In values: - - ingress-nginx + - ${release_name} - key: app.kubernetes.io/component operator: In values: diff --git a/main.tf b/main.tf index fe78b6d..356bb91 100644 --- a/main.tf +++ b/main.tf @@ -1,3 +1,7 @@ +locals { + chart_name = "ingress-nginx" +} + resource "kubernetes_namespace_v1" "this" { count = var.create_namespace ? 1 : 0 @@ -23,7 +27,7 @@ data "kubernetes_namespace_v1" "this" { resource "helm_release" "this" { name = var.helm_release_name repository = "https://kubernetes.github.io/ingress-nginx" - chart = "ingress-nginx" + chart = local.chart_name version = var.chart_version namespace = var.create_namespace ? kubernetes_namespace_v1.this[0].metadata[0].name : data.kubernetes_namespace_v1.this[0].metadata[0].name @@ -36,6 +40,12 @@ resource "helm_release" "this" { ingress_nginx_controller_min_replicas = var.ingress_nginx_controller_min_replicas ingress_nginx_controller_max_replicas = var.ingress_nginx_controller_max_replicas set_controller_default_pod_anti_affinity = var.set_controller_default_pod_anti_affinity + + # Variables for creating the selector labels. + # If you use `nameOverride` in your values, you should use that instead of `chart_name`. + # See how the Helm chart creates the selector labels. + chart_name = local.chart_name + release_name = var.helm_release_name } ) ],