Skip to content
Open
Show file tree
Hide file tree
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 Sep 26, 2025
332714e
Minor changes
vijayaraghavanr31 Oct 3, 2025
38e2a95
Removing unnessary values from values template file
vijayaraghavanr31 Oct 3, 2025
6d7f5c7
added unit testing code
vijayaraghavanr31 Oct 5, 2025
eb67bb3
minor changes
vijayaraghavanr31 Oct 8, 2025
08c624d
formatting changes
vijayaraghavanr31 Oct 8, 2025
2076544
directory changes
vijayaraghavanr31 Oct 9, 2025
c79e174
pre commit changes
vijayaraghavanr31 Oct 9, 2025
d8f0531
feat: updating k8s registration agent chat versions
vijayaraghavanr31 Oct 13, 2025
e3a3c16
feat:Adding before cluster delete hook
vijayaraghavanr31 Oct 14, 2025
91375c1
Apply suggestions from code review
vijayaraghavanr31 Oct 14, 2025
f082997
renaming k8s registration agent to konnector agent
vijayaraghavanr31 Oct 14, 2025
fb4018c
feat: variable name updates
vijayaraghavanr31 Oct 14, 2025
07e6c4d
feat: changin chart name
vijayaraghavanr31 Oct 14, 2025
073f350
feat: konnector agent name change
vijayaraghavanr31 Oct 15, 2025
1147c4a
feat: updating konnector agent doc
vijayaraghavanr31 Oct 15, 2025
3724a82
feat: updating values template
vijayaraghavanr31 Oct 15, 2025
812b844
feat: precommit fix
vijayaraghavanr31 Oct 16, 2025
0a9d85d
feat: Apply suggestions from code review
vijayaraghavanr31 Oct 16, 2025
ef92b3e
feat: pre commit fixes
vijayaraghavanr31 Oct 16, 2025
4ba1594
feat: Unit test fixes
vijayaraghavanr31 Oct 16, 2025
48747d2
feat: updating konnector doc format
vijayaraghavanr31 Oct 16, 2025
715952b
feat: updating chart repo url
vijayaraghavanr31 Oct 17, 2025
dfe85ae
feat: precommit fixes
vijayaraghavanr31 Oct 17, 2025
0458c64
feat: precommit fix
vijayaraghavanr31 Oct 17, 2025
f175449
feat: updating wait logic
vijayaraghavanr31 Oct 17, 2025
f79c5a0
feat: upgrading konnector agent version
vijayaraghavanr31 Oct 23, 2025
decae77
Merge branch 'main' into vijayr/109585-k8sagent-addon-2
vijayaraghavanr31 Oct 23, 2025
cac4570
feat: formatting
vijayaraghavanr31 Oct 23, 2025
2291df3
feat: pre-commit fix
vijayaraghavanr31 Oct 23, 2025
486228a
feat: pre-commit
vijayaraghavanr31 Oct 23, 2025
f13740b
feat: Update api/v1alpha1/addon_types.go
vijayaraghavanr31 Oct 24, 2025
fc1e937
feat: removing addon strategy
vijayaraghavanr31 Oct 24, 2025
a943238
Merge remote-tracking branch 'origin/main' into vijayr/109585-k8sagen…
vijayaraghavanr31 Oct 24, 2025
cdb678b
feat: updating fetch imges file for konnector agent
vijayaraghavanr31 Oct 24, 2025
f80421b
feat: updating helm uninstallation timeouts
vijayaraghavanr31 Oct 27, 2025
44af7d9
feat: updating timout configs
vijayaraghavanr31 Oct 29, 2025
44dcc33
feat: removing intToInt32Ptr from server.go
vijayaraghavanr31 Oct 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions api/v1alpha1/addon_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ type NutanixAddons struct {

// +kubebuilder:validation:Optional
COSI *NutanixCOSI `json:"cosi,omitempty"`

// +kubebuilder:validation:Optional
KonnectorAgent *NutanixKonnectorAgent `json:"konnectorAgent,omitempty"`
}

type GenericAddons struct {
Expand Down Expand Up @@ -371,3 +374,15 @@ type Ingress struct {
// +kubebuilder:validation:Enum="aws-lb-controller"
Provider string `json:"provider"`
}

type NutanixKonnectorAgent struct {
// A reference to the Secret for credential information for the target Prism Central instance
// +kubebuilder:validation:Optional
Credentials *NutanixKonnectorAgentCredentials `json:"credentials,omitempty"`
}

type NutanixKonnectorAgentCredentials struct {
// A reference to the Secret containing the credentials used by the Konnector agent.
// +kubebuilder:validation:Required
SecretRef LocalObjectReference `json:"secretRef"`
}
2 changes: 2 additions & 0 deletions api/v1alpha1/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ const (
ServiceLoadBalancerVariableName = "serviceLoadBalancer"
// RegistryAddonVariableName is the OCI registry config patch variable name.
RegistryAddonVariableName = "registry"
// KonnectorAgentVariableName is the Nutanix konnector-agent addon config patch variable name.
KonnectorAgentVariableName = "konnectorAgent"

// GlobalMirrorVariableName is the global image registry mirror patch variable name.
GlobalMirrorVariableName = "globalImageRegistryMirror"
Expand Down
22 changes: 22 additions & 0 deletions api/v1alpha1/crds/caren.nutanix.com_nutanixclusterconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,28 @@ spec:
- defaultStorage
- providers
type: object
konnectorAgent:
properties:
credentials:
description: A reference to the Secret for credential information for the target Prism Central instance
properties:
secretRef:
description: A reference to the Secret containing the credentials used by the Konnector agent.
properties:
name:
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
maxLength: 253
minLength: 1
type: string
required:
- name
type: object
required:
- secretRef
type: object
type: object
nfd:
description: NFD tells us to enable or disable the node feature discovery addon.
properties:
Expand Down
41 changes: 41 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions api/variables/aggregate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ type Addons struct {
COSI *COSI `json:"cosi,omitempty"`

Ingress *Ingress `json:"ingress,omitempty"`

NutanixKonnectorAgent *NutanixKonnectorAgent `json:"konnectorAgent,omitempty"`
}

type NutanixKonnectorAgent struct {
carenv1.NutanixKonnectorAgent `json:",inline"`
}

type CSI struct {
Expand Down
2 changes: 2 additions & 0 deletions charts/cluster-api-runtime-extensions-nutanix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ A Helm chart for cluster-api-runtime-extensions-nutanix
| hooks.csi.snapshot-controller.helmAddonStrategy.defaultValueTemplateConfigMap.name | string | `"default-snapshot-controller-helm-values-template"` | |
| hooks.ingress.awsLoadBalancerController.defaultValueTemplateConfigMap.create | bool | `true` | |
| hooks.ingress.awsLoadBalancerController.defaultValueTemplateConfigMap.name | string | `"default-aws-load-balancer-controller-helm-values-template"` | |
| hooks.konnectorAgent.helmAddonStrategy.defaultValueTemplateConfigMap.create | bool | `true` | |
| hooks.konnectorAgent.helmAddonStrategy.defaultValueTemplateConfigMap.name | string | `"default-konnector-agent-helm-values-template"` | |
| hooks.nfd.crsStrategy.defaultInstallationConfigMap.name | string | `"node-feature-discovery"` | |
| hooks.nfd.helmAddonStrategy.defaultValueTemplateConfigMap.create | bool | `true` | |
| hooks.nfd.helmAddonStrategy.defaultValueTemplateConfigMap.name | string | `"default-nfd-helm-values-template"` | |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
agent:
name: {{ .AgentName }}
image:
repository: quay.io/karbon
name: k8s-agent
pc:
port: {{ .PrismCentralPort }}
insecure: {{ .PrismCentralInsecure }} #set this to true if PC does not have https enabled
endpoint: {{ .PrismCentralHost }} # eg: ip or fqdn
k8sClusterName: {{ .ClusterName }}
k8sDistribution: NKP
createSecret: false
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ spec:
- --csi.snapshot-controller.helm-addon.default-values-template-configmap-name={{ (index .Values.hooks.csi "snapshot-controller").helmAddonStrategy.defaultValueTemplateConfigMap.name }}
- --ccm.aws.helm-addon.default-values-template-configmap-name={{ .Values.hooks.ccm.aws.helmAddonStrategy.defaultValueTemplateConfigMap.name }}
- --cosi.controller.helm-addon.default-values-template-configmap-name={{ .Values.hooks.cosi.controller.helmAddonStrategy.defaultValueTemplateConfigMap.name }}
- --konnector-agent.helm-addon.default-values-template-configmap-name={{ .Values.hooks.konnectorAgent.helmAddonStrategy.defaultValueTemplateConfigMap.name }}
{{- range $k, $v := .Values.hooks.ccm.aws.k8sMinorVersionToCCMVersion }}
- --ccm.aws.aws-ccm-versions={{ $k }}={{ $v }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ data:
ChartName: cosi
ChartVersion: 0.0.1-alpha.5
RepositoryURL: '{{ if .Values.helmRepository.enabled }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://mesosphere.github.io/charts/stable/{{ end }}'
konnector-agent: |
ChartName: konnector-agent
ChartVersion: 1.3.0-rc.1
RepositoryURL: '{{ if .Values.helmRepository.enabled }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://mesosphere.github.io/charts/stable{{ end }}'
local-path-provisioner-csi: |
ChartName: local-path-provisioner
ChartVersion: 0.0.32
Expand Down
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 -}}
21 changes: 21 additions & 0 deletions charts/cluster-api-runtime-extensions-nutanix/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,27 @@
}
}
},
"konnectorAgent": {
"type": "object",
"properties": {
"helmAddonStrategy": {
"type": "object",
"properties": {
"defaultValueTemplateConfigMap": {
"type": "object",
"properties": {
"create": {
"type": "boolean"
},
"name": {
"type": "string"
}
}
}
}
}
}
},
"nfd": {
"type": "object",
"properties": {
Expand Down
5 changes: 5 additions & 0 deletions charts/cluster-api-runtime-extensions-nutanix/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ hooks:
defaultValueTemplateConfigMap:
create: true
name: default-metallb-helm-values-template
konnectorAgent:
helmAddonStrategy:
defaultValueTemplateConfigMap:
create: true
name: default-konnector-agent-helm-values-template
cosi:
controller:
helmAddonStrategy:
Expand Down
162 changes: 162 additions & 0 deletions docs/content/addons/konnector-agent.md
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)
4 changes: 4 additions & 0 deletions examples/capi-quick-start/nutanix-cluster-calico-crs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ spec:
strategy: HelmAddon
snapshotController:
strategy: HelmAddon
konnectorAgent:
credentials:
secretRef:
name: ${CLUSTER_NAME}-pc-creds-for-konnector-agent
nfd:
strategy: ClusterResourceSet
serviceLoadBalancer:
Expand Down
Loading
Loading