Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: podAntiAffinity uses the right labels #11

Merged
merged 1 commit into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading