Broken support for applications with charts spanning multiple namespaces
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
StarlingX |
Fix Released
|
Medium
|
David Barbosa Bastos |
Bug Description
Brief Description
-----------------
A function was introduced to check if charts are enabled when applying apps. However, it is not finding any charts for Kubevirt because it is looking at the top-level namespace defined on the root kustomization.yaml file. We cannot rely on the top level namespace because 1) it is not mandatory by FluxCD, thus it may not be present, 2) charts spanning multiple namespaces required that not to be set, as defining a namespace on the root kustomization file results in all underlying resources having that same namespace.
Note: This is not happening to other apps because their top-level namespace matches the namespace defined in the app plugins.
A suggestion here is to generate is to generated the resulting manifests with kustomize and parse them, as they will always provide the namespace for the corresponding helm releases, regardless if that namespace was set on the root kustomization file or on the release definition itself. The release namespace is the one that should be passed to the is_chart_enabled method.
Severity
--------
Critical: System/Feature is not usable after the defect
Steps to Reproduce
------------------
Upload and apply Kubevirt app.
Add an override. For example:
system helm-override-
Reapply the app.
Replica numbers will not be changed.
Expected Behavior
------------------
Kubevirt applies and Helm overrides are respected
Actual Behavior
----------------
Kubevirt applies but Helm overrides do not work
Reproducibility
---------------
100% Reproducible
System Configuration
-------
SW_VERSION="24.09"
BUILD_TARGET=
BUILD_TYPE=
BUILD_ID="n/a"
JOB="n/a"
BUILD_BY=
BUILD_NUMBER="n/a"
Branch/Pull Time/Commit
-------
Branch and the time when code was pulled or git commit or cengn load info
Last Pass
---------
Before https:/
Timestamp/Logs
--------------
sysinv 2024-06-01 11:54:15.493 13106 WARNING sysinv.common.utils [-] is_chart_enabled: kubevirt-
sysinv 2024-06-01 11:54:15.493 13106 ERROR sysinv.
sysinv 2024-06-01 11:54:15.494 13106 INFO sysinv.
sysinv 2024-06-01 11:54:15.972 13106 INFO sysinv.
Test Activity
-------------
Developer Testing
Workaround
----------
n/a
Changed in starlingx: | |
assignee: | nobody → David Barbosa Bastos (dbarbosa-wr) |
Changed in starlingx: | |
status: | New → In Progress |
Changed in starlingx: | |
importance: | Undecided → Medium |
tags: | added: stx.10.0 stx.apps |
Reviewed: https:/ /review. opendev. org/c/starlingx /config/ +/922932 /opendev. org/starlingx/ config/ commit/ 674e38adf8ed55e 1daff176af65e7a 415c4591b1
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 674e38adf8ed55e 1daff176af65e7a 415c4591b1
Author: David Bastos <email address hidden>
Date: Thu Jun 27 09:46:12 2024 -0300
Fix support for apps with multiple namespaces
Helm allows charts to span multiple namespaces. However, the on.yaml file means that a single namespace would be used
behavior implemented in the Application Framework was using only
namespaces available on kustomization.yaml files to look for enabled
charts. This strategy breaks the multiple namespace support because
kustomize requires each HelmRelease resource to have a different
namespace to support this scenario. Using a namespace on the a
kustomizati
across all underlying resources, including Helm releases.
As a result, the "is_chart_enabled" function, would always return no
charts for the multiple namespaces scenario, since the release
namespace and the namespace used by the framework would not match,
causing Helm overrides not to work correctly.
The solution consists of using the output of the "kubectl kustomize directory> " command and checking the namespace present on.yaml file or explicitly defined on the release manifest.
<fluxcd_
within each HelmRelease. That way we ensure that the HelmRelease
manifest always has a namespace, whether it is inherited by a
kustomizati
Test Plan: update" and when reapplying the app,
namespace: "system helm-override- update kubevirt-app
kubevirt- app kubevirt --set replicas=3". After running the
successfully .
namespace: "system helm-override- update kubevirt-app
kubevirt- app cdi --set replicas=3". After running the command
PASS: Upload, apply, remove and delete platform-integ-app
PASS: Upload, apply, remove and delete metrics-server
PASS: Upload, apply, remove and delete Kubevirt
PASS: Update user overrides to metrics-server and platform-integ-app
via "system helm-override-
the changes were made successfully
PASS: Update the user overrides of the kubevirt app for the kubevirt
command and reapplying the app, the changes were made
PASS: Update the user overrides of the kubevirt app for the cdi
and reapplying the app, the changes were made successfully.
Closes-bug: 2071380
Change-Id: I8a7535a4303f3a 64d99cc8cc3db36 bd2d6d6ba5d
Signed-off-by: David Bastos <email address hidden>