feat: Add support for deploying K8s Agent as Helm Addon during cluster deployment #1344
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?:
This PR introduces support for deploying the Nutanix K8s Agent as a Helm-based addon as part of the cluster deployment workflow in the CAREN repository.
Key changes:
Added support for HelmAddon strategy in the K8s Registration Agent handler.
Updated handler logic to fetch and apply Helm chart configuration dynamically using the provided credentials.
Created unit tests to validate HelmAddon flow and error scenarios.
Ensured the agent’s credentials are handled securely through Kubernetes Secrets instead of directly passing via values.yaml.
This enhancement enables seamless installation of the K8s Agent via HelmReleaseProxy (HRP) and HelmChartProxy (HCP) without manual post-deployment intervention.
Motivation
Previously, the K8s Agent installation was not integrated into the cluster creation process and required manual setup.
By integrating it as an addon:
The K8s Agent will be automatically deployed during cluster provisioning.
Sensitive credentials are now secured using Kubernetes Secrets.
This aligns the agent deployment with other addon-based lifecycle management mechanisms.
Which issue(s) this PR fixes:
Fixes #
How Has This Been Tested?:
Verified K8s Agent deployment using the HelmAddon strategy.
Confirmed that:
Pre-install hooks execute as expected.
The secret is created and retained after installation.
Post-upgrade hooks are triggered correctly.
Added unit tests under k8sregistrationagent/handler_test.go
K8s agent documentation
Special notes for your reviewer: