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

Improve the helm values autodetection logic #2365

Merged
merged 7 commits into from
Mar 12, 2024

Conversation

giorio94
Copy link
Member

@giorio94 giorio94 commented Mar 5, 2024

Please review commit by commit, and refer to the individual messages for additional details.

  • Remove unused fields/parameters from the getHelmValues logic;
  • Drop support for EOL Cilium v1.11 and earlier in helm values generation;
  • Drop broken bpf.masquerade autodetection logic;
  • Fix retrieval of the user-configured routing mode, and uniform retrieval of nested helm value;
  • Improve KPR autodetection logic to not override user configuration, and not configure deprecated values;
  • Fix KPR probing in connectivity tests to account for both legacy and current values.
  • Replace the remaining references to deprecated KPR settings in GHA workflows.

giorio94 added 4 commits March 5, 2024 11:43
It appears that they are no longer used after removing the
legacy installation logic.

Signed-off-by: Marco Iorio <[email protected]>
Cilium v1.11 and earlier have been EOL for more than six months now.
Hence, let's stop caring about them when auto-configuring the helm
values.

Signed-off-by: Marco Iorio <[email protected]>
The current logic is supposed to automatically enable BPF masquerade
when KPR is enabled, and IPv6 is not enabled. However, it looks like
it is broken since 9ddd6d8 ("install: Do not use individual
HelmOpts"), because we iterate on a map of maps containing the rendered
values, but attempt to match the values against --set strings.

Instead of fixing it, let's just remove this logic altogether for the
sake of simplicity. Additionally, it is potentially fragile, and may
lead to surprises to users (as well as in CI) given the difference with
respect to the default Cilium's values, and a plain helm install.

Signed-off-by: Marco Iorio <[email protected]>
Let's replace the custom logic to retrieve a specific helm value with
the unstructured.NestedString method, to ensure consistency among the
different call sites. Additionally, this change fixes the retrieval
of the routing mode configured by the user, which was previously
never obtained correctly, due to a format mismatch.

Signed-off-by: Marco Iorio <[email protected]>
Make sure that the autodetected values don't override possible user
configurations. Additionally, adapt the kubeProxyReplacement value
based on the CIlium version, as strict got deprevated in v1.14.

Signed-off-by: Marco Iorio <[email protected]>
@giorio94
Copy link
Member Author

giorio94 commented Mar 6, 2024

The failure appears to be legitimate, as it uncovered an already existing bug causing incorrect KPR features detection when configured using the new format (i.e., true|false). Converting back to draft while addressing it.

@giorio94 giorio94 marked this pull request as draft March 6, 2024 09:17
giorio94 added 2 commits March 6, 2024 10:41
Currently, KPR feature determination considered only the legacy
disabled|partial|strict values, while ignoring the false|true
possibilities. This issue caused little harm so far because we
never directly relied upon it, but only probed for subfeatures
(mainly KPRNodePort and KPRHostPort). One special case is
represented by north-sourth-loadbalancing/outside-to-nodeport
tests, which disable flow validation when the KPR NodePort
implementation is disabled. However, due to a bug, this worked
only when KPR mode was set to "Disabled", regardless of whether
it was enabled or not in all other circumstances.

Let's address this by generalizing the KPR feature detection
logic, as well as correctly checking the KPR NodePort status
as part of the outside-to-nodeport tests.

Signed-off-by: Marco Iorio <[email protected]>
@giorio94
Copy link
Member Author

giorio94 commented Mar 6, 2024

I've pushed a commit to address the KPR feature detection issue. Back to reviewable state.

@giorio94 giorio94 marked this pull request as ready for review March 6, 2024 09:43
@giorio94 giorio94 requested a review from a team as a code owner March 6, 2024 09:43
@giorio94 giorio94 requested a review from aspsk March 6, 2024 09:43
Copy link
Member

@gandro gandro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup!

Copy link
Contributor

@michi-covalent michi-covalent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i didn't know about unstructured.NestedString. very cool 🥰

@michi-covalent
Copy link
Contributor

@tommyp1ckles @aspsk ping!

Copy link
Member

@sayboras sayboras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks ✔️

@michi-covalent
Copy link
Contributor

6 approvals. good enough for me.

@michi-covalent michi-covalent merged commit dbd3594 into cilium:main Mar 12, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants