-
Couldn't load subscription status.
- Fork 8
feat: Add support for deploying K8s Agent as Helm Addon during cluster deployment #1345
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
Open
vijayaraghavanr31
wants to merge
38
commits into
main
Choose a base branch
from
vijayr/109585-k8sagent-addon-2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
cd63d0f
K8s agent as addon
vijayaraghavanr31 332714e
Minor changes
vijayaraghavanr31 38e2a95
Removing unnessary values from values template file
vijayaraghavanr31 6d7f5c7
added unit testing code
vijayaraghavanr31 eb67bb3
minor changes
vijayaraghavanr31 08c624d
formatting changes
vijayaraghavanr31 2076544
directory changes
vijayaraghavanr31 c79e174
pre commit changes
vijayaraghavanr31 d8f0531
feat: updating k8s registration agent chat versions
vijayaraghavanr31 e3a3c16
feat:Adding before cluster delete hook
vijayaraghavanr31 91375c1
Apply suggestions from code review
vijayaraghavanr31 f082997
renaming k8s registration agent to konnector agent
vijayaraghavanr31 fb4018c
feat: variable name updates
vijayaraghavanr31 07e6c4d
feat: changin chart name
vijayaraghavanr31 073f350
feat: konnector agent name change
vijayaraghavanr31 1147c4a
feat: updating konnector agent doc
vijayaraghavanr31 3724a82
feat: updating values template
vijayaraghavanr31 812b844
feat: precommit fix
vijayaraghavanr31 0a9d85d
feat: Apply suggestions from code review
vijayaraghavanr31 ef92b3e
feat: pre commit fixes
vijayaraghavanr31 4ba1594
feat: Unit test fixes
vijayaraghavanr31 48747d2
feat: updating konnector doc format
vijayaraghavanr31 715952b
feat: updating chart repo url
vijayaraghavanr31 dfe85ae
feat: precommit fixes
vijayaraghavanr31 0458c64
feat: precommit fix
vijayaraghavanr31 f175449
feat: updating wait logic
vijayaraghavanr31 f79c5a0
feat: upgrading konnector agent version
vijayaraghavanr31 decae77
Merge branch 'main' into vijayr/109585-k8sagent-addon-2
vijayaraghavanr31 cac4570
feat: formatting
vijayaraghavanr31 2291df3
feat: pre-commit fix
vijayaraghavanr31 486228a
feat: pre-commit
vijayaraghavanr31 f13740b
feat: Update api/v1alpha1/addon_types.go
vijayaraghavanr31 fc1e937
feat: removing addon strategy
vijayaraghavanr31 a943238
Merge remote-tracking branch 'origin/main' into vijayr/109585-k8sagen…
vijayaraghavanr31 cdb678b
feat: updating fetch imges file for konnector agent
vijayaraghavanr31 f80421b
feat: updating helm uninstallation timeouts
vijayaraghavanr31 44af7d9
feat: updating timout configs
vijayaraghavanr31 44dcc33
feat: removing intToInt32Ptr from server.go
vijayaraghavanr31 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
charts/cluster-api-runtime-extensions-nutanix/addons/konnector-agent/values-template.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| agent: | ||
| name: {{ .AgentName }} | ||
| image: | ||
vijayaraghavanr31 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| repository: quay.io/karbon | ||
| name: k8s-agent | ||
dkoshkin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| pc: | ||
| port: {{ .PrismCentralPort }} | ||
| insecure: {{ .PrismCentralInsecure }} #set this to true if PC does not have https enabled | ||
vijayaraghavanr31 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| endpoint: {{ .PrismCentralHost }} # eg: ip or fqdn | ||
| k8sClusterName: {{ .ClusterName }} | ||
| k8sDistribution: NKP | ||
| createSecret: false | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...ter-api-runtime-extensions-nutanix/templates/konnector-agent/helm-addon-installation.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # Copyright 2025 Nutanix. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| {{- if .Values.hooks.konnectorAgent.helmAddonStrategy.defaultValueTemplateConfigMap.name }} | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: '{{ .Values.hooks.konnectorAgent.helmAddonStrategy.defaultValueTemplateConfigMap.name }}' | ||
| data: | ||
| values.yaml: |- | ||
| {{- .Files.Get "addons/konnector-agent/values-template.yaml" | nindent 4 }} | ||
| {{- end -}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,162 @@ | ||
| +++ | ||
| title = "Konnector Agent Addon" | ||
| icon = "fa-solid fa-plug" | ||
| +++ | ||
|
|
||
| The Konnector Agent addon enables automatic registration of Kubernetes clusters with Nutanix Prism Central. This addon leverages Cluster API lifecycle hooks to deploy the [Konnector Agent](https://portal.nutanix.com/page/documents/details?targetId=Prism-Central-Guide-vpc_7_3:mul-cluster-kubernetes-clusters-manage-pc-c.html) on the new clusters. | ||
|
|
||
| ## Overview | ||
|
|
||
| Konnector Agent's addon management via CAREN(Cluster API Runtime Extensions - Nutanix) provides: | ||
|
|
||
| - **Automatic cluster registration** with Nutanix Prism Central | ||
| - **Lifecycle management** through Cluster API hooks | ||
| - **Credential management** for secure Prism Central connectivity | ||
|
|
||
| ## Lifecycle Hooks | ||
|
|
||
| The addon implements the following Cluster API lifecycle hooks: | ||
|
|
||
| ### AfterControlPlaneInitialized | ||
|
|
||
| - **Purpose**: Deploys the Konnector Agent after the control plane is ready | ||
| - **Timing**: Executes when the cluster control plane is fully initialized | ||
| - **Actions**: | ||
| - Creates credentials secret on the target cluster | ||
| - Deploys the Konnector Agent using the specified strategy | ||
| - Configures Prism Central connectivity | ||
|
|
||
| ### BeforeClusterUpgrade | ||
|
|
||
| - **Purpose**: Ensures the agent is properly configured before cluster upgrades | ||
| - **Timing**: Executes before cluster upgrade operations | ||
| - **Actions**: Re-applies the agent configuration if needed | ||
|
|
||
| ### BeforeClusterDelete | ||
|
|
||
| - **Purpose**: Gracefully removes the Konnector Agent before cluster deletion | ||
| - **Timing**: Executes before cluster deletion begins | ||
| - **Actions**: | ||
| - Initiates graceful helm uninstall | ||
| - Waits for cleanup completion | ||
| - Ensures proper cleanup order | ||
|
|
||
| ## Configuration | ||
|
|
||
| ```yaml | ||
| apiVersion: cluster.x-k8s.io/v1beta1 | ||
| kind: Cluster | ||
| metadata: | ||
| name: my-cluster | ||
| spec: | ||
| topology: | ||
| variables: | ||
| - name: clusterConfig | ||
| value: | ||
| addons: | ||
| konnectorAgent: | ||
| strategy: HelmAddon | ||
| credentials: | ||
| secretRef: | ||
| name: cluster-name-pc-credentials-for-konnector-agent | ||
| ``` | ||
|
|
||
| ## Configuration Reference | ||
|
|
||
| ### NutanixKonnectorAgent | ||
|
|
||
| | Field | Type | Required | Default | Description | | ||
| |-------|------|----------|---------|-------------| | ||
| | `strategy` | string | No | `HelmAddon` | Deployment strategy (`HelmAddon`) | | ||
| | `credentials` | object | No | - | Prism Central credentials configuration | | ||
|
|
||
| ### NutanixKonnectorAgentCredentials | ||
|
|
||
| | Field | Type | Required | Description | | ||
| |-------|------|----------|-------------| | ||
| | `secretRef.name` | string | Yes | Name of the Secret containing Prism Central credentials | | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| ### 1. Prism Central Credentials Secret | ||
|
|
||
| Create a secret containing Prism Central credentials: | ||
|
|
||
| ```yaml | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: cluster-name-pc-credentials-for-konnector-agent | ||
| namespace: default | ||
| type: Opaque | ||
| stringData: | ||
| username: admin | ||
| password: password | ||
| ``` | ||
|
|
||
| ### Example Configuration | ||
|
|
||
| ```yaml | ||
| apiVersion: cluster.x-k8s.io/v1beta1 | ||
| kind: Cluster | ||
| metadata: | ||
| name: custom-credentials-cluster | ||
| spec: | ||
| topology: | ||
| variables: | ||
| - name: clusterConfig | ||
| value: | ||
| addons: | ||
| konnectorAgent: | ||
| strategy: HelmAddon | ||
| credentials: | ||
| secretRef: | ||
| name: cluster-name-pc-credentials-for-konnector-agent | ||
| ``` | ||
|
|
||
| ## Default Values | ||
|
|
||
| The addon uses the following default values: | ||
|
|
||
| - **Helm Release Name**: `konnector-agent` | ||
| - **Namespace**: `ntnx-system` | ||
| - **Agent Name**: `konnector-agent` | ||
| - **Strategy**: `HelmAddon` | ||
| - **Chart**: `konnector-agent` | ||
| - **Version**: `1.3.0-rc.1` | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### Common Issues | ||
|
|
||
| 1. **Missing Credentials Secret** | ||
| - Ensure the secret exists in the management cluster | ||
| - Verify the secret name matches the configuration | ||
|
|
||
| 2. **Prism Central Connectivity** | ||
| - Check network connectivity between the cluster and Prism Central | ||
| - Verify the Prism Central endpoint is correct | ||
| - Ensure credentials are valid | ||
|
|
||
| 3. **Helm Chart Issues** | ||
| - Check the Helm repository is accessible | ||
| - Verify the chart version exists | ||
| - Review HelmChartProxy status | ||
|
|
||
| ### Monitoring | ||
|
|
||
| Monitor the Konnector Agent deployment: | ||
|
|
||
| ```bash | ||
| # Check HelmChartProxy status | ||
| kubectl get hcp -A | ||
|
|
||
| # Check agent logs | ||
| kubectl logs hook-preinstall -n ntnx-system | ||
| ``` | ||
|
|
||
| ## References | ||
|
|
||
| - [Konnector Agent](https://portal.nutanix.com/page/documents/details?targetId=Prism-Central-Guide-vpc_7_3:mul-cluster-kubernetes-clusters-manage-pc-c.html) | ||
| - [Cluster API Add-on Provider for Helm](https://github.com/kubernetes-sigs/cluster-api-addon-provider-helm) | ||
| - [Cluster API Runtime Hooks](https://cluster-api.sigs.k8s.io/tasks/experimental-features/runtime-sdk/hooks.html) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.