Skip to content

Commit fe17f77

Browse files
fix: conditionally set ingress-nginx chart version based on cadence and K8s minor version (PSCLOUD-99) (#666)
1 parent 3bcfb3c commit fe17f77

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

docs/CONFIG-VARS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ By default, two block storage StorageClasses are created using the driver, one f
414414
| INGRESS_NGINX_NAMESPACE | NGINX Ingress Helm installation namespace | string | ingress-nginx | false | | baseline |
415415
| INGRESS_NGINX_CHART_URL | NGINX Ingress Helm chart URL | string | See [this document](https://kubernetes.github.io/ingress-nginx) for more information. | false | | baseline |
416416
| INGRESS_NGINX_CHART_NAME | NGINX Ingress Helm chart name | string | ingress-nginx | false | | baseline |
417-
| INGRESS_NGINX_CHART_VERSION | NGINX Ingress Helm chart version | string | "" | false | If left as "" (empty string), version `4.13.0` is used for Kubernetes clusters whose version is >= 1.29.X, for Kubernetes clusters whose version is <= 1.28.X you must set this variable to avoid errors. See [Supported Versions table](https://github.com/kubernetes/ingress-nginx/?tab=readme-ov-file#supported-versions-table) for the supported versions list. | baseline |
417+
| INGRESS_NGINX_CHART_VERSION | NGINX Ingress Helm chart version | string | "" | false | If left as "" (empty string), the version is automatically set based on both Kubernetes minor version and cadence version: If Kubernetes minor version >= 1.29.X and cadence version <= 2025.07 → version `4.12.1` is used; If Kubernetes minor version >= 1.29.X and cadence version >= 2025.08 → version `4.13.0` is used; If Kubernetes minor version <= 1.28.X, you must manually set this variable to avoid errors; If defined in `ansible-var.yaml`, the provided value takes precedence over the above logic. See [Supported Versions table](https://github.com/kubernetes/ingress-nginx/?tab=readme-ov-file#supported-versions-table) for the supported versions list. | baseline |
418418
| INGRESS_NGINX_CONFIG | NGINX Ingress Helm values | string | See [this file](../roles/baseline/defaults/main.yml) for more information. Altering this value will affect the cluster. | false | | baseline |
419419

420420
### Metrics Server

roles/baseline/tasks/ingress-nginx.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,15 @@
2727
- install
2828
- update
2929
block:
30-
# Set the chart version based on cadence version
31-
- name: Set ingress-nginx chart version based on cadence
32-
set_fact:
33-
INGRESS_NGINX_CHART_VERSION: "{{ '4.12.1' if V4_CFG_CADENCE_VERSION | float <= 2025.07 else '4.13.0' }}"
3430
# Retrieve Kubernetes cluster version information
3531
- name: Retrieve K8s cluster information
3632
kubernetes.core.k8s_cluster_info:
3733
kubeconfig: "{{ KUBECONFIG }}"
3834
register: cluster_info
39-
# Set the chart version based on the minor version of the Kubernetes server
40-
- name: Set the default INGRESS_NGINX_CHART_VERSION based on K8s server minor version
35+
# Set the chart version based on cadence version if K8s version is >= threshold
36+
- name: Set ingress-nginx chart version
4137
set_fact:
42-
INGRESS_NGINX_CHART_VERSION: "{{ ingressVersions.k8sMinorVersion.api.chartVersion if cluster_info.version.server.kubernetes.minor is version(ingressVersions.k8sMinorVersion.value, 'ge') else '' }}"
38+
INGRESS_NGINX_CHART_VERSION: "{{ ('4.12.1' if V4_CFG_CADENCE_VERSION is version('2025.07', '<=') else '4.13.0') if cluster_info.version.server.kubernetes.minor | int >= ingressVersions.k8sMinorVersion.value | int else '' }}"
4339
# Output the selected chart version for debugging
4440
- name: Output INGRESS_NGINX_CHART_VERSION
4541
debug:

0 commit comments

Comments
 (0)