-
Notifications
You must be signed in to change notification settings - Fork 208
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
feat: Make Cilium CLI work with Cilium installed through helm with a non-default name. #2430
feat: Make Cilium CLI work with Cilium installed through helm with a non-default name. #2430
Conversation
cli/clustermesh.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: No changes were made to clustermesh connect
and clustermesh disconnect
to support a Helm release name override for the remote cluster that would be different than the local cluster.
I felt that it would be best to take an opinionated stance that both clusters should be similarly configured. (i.e. use the same Helm release name) The constraint already exists for the namespace name. Deviation would probably create difficulty for the community that supports this project.
Tested with a default installation and with a custom Helm release name installation. The associated CLI sub-commands were tested across the two installations with and without the new flag. Additionally, combination testing was done with |
Commit 7ec19cb does not match "Signed-off-by". Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin |
7ec19cb
to
487c64b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thank you so much!
I've left some minor inline comments.
A note on the git commits themselves:
Please do not use merge commits, use rebase instead.
Also, please line break your git commit description at ~80-100 character limit per line.
Otherwise this looks excellent!
@@ -34,6 +34,10 @@ func newCmdSysdump(hooks sysdump.Hooks) *cobra.Command { | |||
if sysdumpOptions.CiliumNamespace == "" && cmd.Flags().Changed("namespace") { | |||
sysdumpOptions.CiliumNamespace = namespace | |||
} | |||
// Honor --helm-release-name global flag in case it is set and --cilium-helm-release-name is not set | |||
if sysdumpOptions.CiliumHelmReleaseName == "" && cmd.Flags().Changed("helm-release-name") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we deprecate cilium-helm-release-name
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering where a change in this would break things. IMO, for a manual diagnostic tool I'd have a lower level of caution. But sysdump
can be called by connectivity test
, so there's three places to set the helmReleaseName.
Would the process be:
- Open an issue noting the deprecation.
- Put a
// TODO: Deprecated by #nnnn
on these lines.
487c64b
to
c2238b9
Compare
The EKS (tunnel) workflow works fine when run from my account/cluster. It could be failing due to spot interruptions; even though those instance types report <5% interruption rate. The logs show that a pod can't be found. |
e6530c7
to
334a8ef
Compare
Adding @tklauser (one of the maintainers) as a reviewer to also get his eyes on this change, to make sure we're not missing anything |
334a8ef
to
e6530c7
Compare
e6530c7
to
c720a89
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
@matthewhembree it looks like this PR picked up a merge conflict. Could you please rebase your branch on latest |
This update introduces a new parameter across several functions and actions to allow the user to specify a Helm release name for the Cilium installation. This enables referencing installations installed via Helm directly. The default Helm release name remains "cilium" when no custom release name is provided. Fixes: cilium#2274 Signed-off-by: Matthew Hembree <47449406+matthewhembree@users.noreply.github.com>
In this update, several log messages in the sysdump.go file have been refactored to provide a clearer output. This was achieved by introducing colons for namespace detections and consistently formatting namespace outputs across messages. A small change radius was maintained for this commit. There were other log messages that could have been updated, but left in place. Signed-off-by: Matthew Hembree <47449406+matthewhembree@users.noreply.github.com>
This is to allow `cilium hubble disable --helm-release-name foo` as missing from a previous/complimentary commit. Fixes: cilium#2274 Signed-off-by: Matthew Hembree <47449406+matthewhembree@users.noreply.github.com>
…ninstall. This is to allow `cilium uninstall --helm-release-name foo` to correctly uninstall Hubble before uninstalling the core Cilium. This includes a fix to specify the namespace. Fixes: cilium#2274 Signed-off-by: Matthew Hembree <47449406+matthewhembree@users.noreply.github.com>
…ium install|uninstall --wait. This is to correct a case where `cilium uninstall --wait` would be configured to wait for Hubble to uninstall(disable), but have an implied duration of 0. Causing a quasi-false error log message. The exit code is still 0, but it was misleading to see the error log in CI. Signed-off-by: Matthew Hembree <47449406+matthewhembree@users.noreply.github.com>
The code in the install.go file has been rearranged. Helm properties such as 'HelmRepository' and 'HelmReleaseName' have been moved to the top for better visibility, while 'ListVersions' and 'NodesWithoutCilium' have been moved to the bottom. The aim was to enhance code readability and organization. Signed-off-by: Matthew Hembree <47449406+matthewhembree@users.noreply.github.com>
The default Helm release name for Cilium, previously in "defaults .go", has been moved to "sysdump.go". This change was made to ensure that the default value is readily available in the same file where it's solely used. Now, the sysdump file locally hosts the private 'helmReleaseName' constant, which is directly assigned to 'CiliumHelmReleaseName' (cilium sysdump --cilium-helm-release-name) if it's not set by the user. Signed-off-by: Matthew Hembree <47449406+matthewhembree@users.noreply.github.com>
Removed unused Helm-related definitions in defaults.go file. Two constants, HelmValuesSecretKeyName and HelmChartVersionSecretKeyName, were unused and hence deleted. Signed-off-by: Matthew Hembree <47449406+matthewhembree@users.noreply.github.com>
c720a89
to
b7f1c50
Compare
AKS workflow failed because of #2446 (comment), fixed in #2452. All other workflows passed. Merging. |
This update introduces a new parameter across several functions and actions to allow the user to specify a Helm release name for the Cilium installation. This enables referencing installations installed via Helm directly. The default Helm release name remains "cilium" when no custom release name is provided.
The new global flag proposed here is:
--helm-release-name
.Fixes: #2274
Signed-off-by: Matthew Hembree 47449406+matthewhembree@users.noreply.github.com