Skip to content
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
2 changes: 1 addition & 1 deletion docs/CONFIG-VARS.md
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ By default, two block storage StorageClasses are created using the driver, one f
| INGRESS_NGINX_NAMESPACE | NGINX Ingress Helm installation namespace | string | ingress-nginx | false | | baseline |
| INGRESS_NGINX_CHART_URL | NGINX Ingress Helm chart URL | string | See [this document](https://kubernetes.github.io/ingress-nginx) for more information. | false | | baseline |
| INGRESS_NGINX_CHART_NAME | NGINX Ingress Helm chart name | string | ingress-nginx | false | | baseline |
| 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 |
| 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 |
| 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 |

### Metrics Server
Expand Down
10 changes: 3 additions & 7 deletions roles/baseline/tasks/ingress-nginx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,15 @@
- install
- update
block:
# Set the chart version based on cadence version
- name: Set ingress-nginx chart version based on cadence
set_fact:
INGRESS_NGINX_CHART_VERSION: "{{ '4.12.1' if V4_CFG_CADENCE_VERSION | float <= 2025.07 else '4.13.0' }}"
# Retrieve Kubernetes cluster version information
- name: Retrieve K8s cluster information
kubernetes.core.k8s_cluster_info:
kubeconfig: "{{ KUBECONFIG }}"
register: cluster_info
# Set the chart version based on the minor version of the Kubernetes server
- name: Set the default INGRESS_NGINX_CHART_VERSION based on K8s server minor version
# Set the chart version based on cadence version if K8s version is >= threshold
- name: Set ingress-nginx chart version
set_fact:
INGRESS_NGINX_CHART_VERSION: "{{ ingressVersions.k8sMinorVersion.api.chartVersion if cluster_info.version.server.kubernetes.minor is version(ingressVersions.k8sMinorVersion.value, 'ge') else '' }}"
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 '' }}"
# Output the selected chart version for debugging
- name: Output INGRESS_NGINX_CHART_VERSION
debug:
Expand Down