Fix node_count and worker_node_count evaluation in CI
Closes #2600 (closed)
The Helm templating logic for calculating node_count and worker_node_count was incorrectly resolving to 0 for worker nodes on CI platforms, even when valid worker node configurations were present in the input values.
Root Cause:
replicas: '{{ ternary 1 3 (eq .Values.cluster.capi_providers.infra_provider "capm3") | include "preserve-type" }}' in https://gitlab.com/sylva-projects/sylva-elements/ci-tooling/ci-deployment-values/-/blob/main/common/ha.yml?ref_type=heads#L8
What's changed in MR:
Added {{- tuple . "cluster.machine_deployments" | include "interpret" -}}
It will force the interpretation of cluster.machine_deployments before ranging through them.
Additionally, added:
cluster:
machine_deployments: {}
…in values.yaml to ensure the path always exists, without this it was giving error: executing "gotpl" at <.Values.cluster.machine_deployments>: range can't iterate over
cc: @cristian.manda
CI configuration
Below you can choose test deployment variants to run in this MR's CI.
Click to open to CI configuration
Legend:
| Icon | Meaning | Available values |
|---|---|---|
| Infra Provider |
capd, capo, capm3
|
|
| Bootstrap Provider |
kubeadm (alias kadm), rke2
|
|
| Node OS |
ubuntu, suse
|
|
| Deployment Options |
light-deploy, dev-sources, ha, misc, maxsurge-0, logging, no-logging
|
|
| Pipeline Scenarios | Available scenario list and description |
-
☁️ capm3🚀 rke2🛠️ misc,ha🐧 suse -
☁️ capm3🚀 rke2🎬 sylva-upgrade-from-1.4.x🛠️ ha,misc🐧 suse -
☁️ capo🚀 rke2🎬 sylva-upgrade-from-1.4.x🛠️ ha,misc🐧 ubuntu
Global config for deployment pipelines
-
autorun pipelines -
allow failure on pipelines -
record sylvactl events
Notes:
- Enabling
autorunwill make deployment pipelines to be run automatically without human interaction - Disabling
allow failurewill make deployment pipelines mandatory for pipeline success. - if both
autorunandallow failureare disabled, deployment pipelines will need manual triggering but will be blocking the pipeline
Be aware: after configuration change, pipeline is not triggered automatically.
Please run it manually (by clicking the run pipeline button in Pipelines tab) or push new code.