Skip to content

Commit

Permalink
Merge pull request #11 from sparkfabrik/fix/fix_pod_antiaffinity_conf…
Browse files Browse the repository at this point in the history
…iguration

fix: podAntiAffinity uses the right labels
  • Loading branch information
Monska85 authored May 13, 2024
2 parents b9ee429 + fc46a7b commit 82afa5e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions files/values.yaml.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
12 changes: 11 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
locals {
chart_name = "ingress-nginx"
}

resource "kubernetes_namespace_v1" "this" {
count = var.create_namespace ? 1 : 0

Expand All @@ -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

Expand All @@ -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
}
)
],
Expand Down

0 comments on commit 82afa5e

Please sign in to comment.