|
| 1 | ++++ |
| 2 | +title = "Konnector Agent Addon" |
| 3 | +icon = "fa-solid fa-plug" |
| 4 | ++++ |
| 5 | + |
| 6 | +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://github.com/nutanix-core/k8s-agent) on the new clusters. |
| 7 | + |
| 8 | +## Overview |
| 9 | + |
| 10 | +The Konnector Agent addon provides: |
| 11 | +- **Automatic cluster registration** with Nutanix Prism Central |
| 12 | +- **Lifecycle management** through Cluster API hooks |
| 13 | +- **Credential management** for secure Prism Central connectivity |
| 14 | + |
| 15 | +## Lifecycle Hooks |
| 16 | + |
| 17 | +The addon implements the following Cluster API lifecycle hooks: |
| 18 | + |
| 19 | +### AfterControlPlaneInitialized |
| 20 | +- **Purpose**: Deploys the Konnector Agent after the control plane is ready |
| 21 | +- **Timing**: Executes when the cluster control plane is fully initialized |
| 22 | +- **Actions**: |
| 23 | + - Creates credentials secret on the target cluster |
| 24 | + - Deploys the Konnector Agent using the specified strategy |
| 25 | + - Configures Prism Central connectivity |
| 26 | + |
| 27 | +### BeforeClusterUpgrade |
| 28 | +- **Purpose**: Ensures the agent is properly configured before cluster upgrades |
| 29 | +- **Timing**: Executes before cluster upgrade operations |
| 30 | +- **Actions**: Re-applies the agent configuration if needed |
| 31 | + |
| 32 | +### BeforeClusterDelete |
| 33 | +- **Purpose**: Gracefully removes the Konnector Agent before cluster deletion |
| 34 | +- **Timing**: Executes before cluster deletion begins |
| 35 | +- **Actions**: |
| 36 | + - Initiates graceful helm uninstall |
| 37 | + - Waits for cleanup completion |
| 38 | + - Ensures proper cleanup order |
| 39 | + |
| 40 | +## Configuration |
| 41 | + |
| 42 | +### Basic Configuration |
| 43 | + |
| 44 | +```yaml |
| 45 | +apiVersion: cluster.x-k8s.io/v1beta1 |
| 46 | +kind: Cluster |
| 47 | +metadata: |
| 48 | + name: my-cluster |
| 49 | +spec: |
| 50 | + topology: |
| 51 | + variables: |
| 52 | + - name: clusterConfig |
| 53 | + value: |
| 54 | + addons: |
| 55 | + konnectorAgent: {} |
| 56 | +``` |
| 57 | +
|
| 58 | +### Advanced Configuration |
| 59 | +
|
| 60 | +```yaml |
| 61 | +apiVersion: cluster.x-k8s.io/v1beta1 |
| 62 | +kind: Cluster |
| 63 | +metadata: |
| 64 | + name: my-cluster |
| 65 | +spec: |
| 66 | + topology: |
| 67 | + variables: |
| 68 | + - name: clusterConfig |
| 69 | + value: |
| 70 | + addons: |
| 71 | + konnectorAgent: |
| 72 | + strategy: HelmAddon |
| 73 | + credentials: |
| 74 | + secretRef: |
| 75 | + name: prism-central-credentials-for-konnector-agent |
| 76 | +``` |
| 77 | +
|
| 78 | +## Configuration Reference |
| 79 | +
|
| 80 | +### NutanixKonnectorAgent |
| 81 | +
|
| 82 | +| Field | Type | Required | Default | Description | |
| 83 | +|-------|------|----------|---------|-------------| |
| 84 | +| `strategy` | string | No | `HelmAddon` | Deployment strategy (`HelmAddon`) | |
| 85 | +| `credentials` | object | No | - | Prism Central credentials configuration | |
| 86 | + |
| 87 | +### NutanixKonnectorAgentCredentials |
| 88 | + |
| 89 | +| Field | Type | Required | Description | |
| 90 | +|-------|------|----------|-------------| |
| 91 | +| `secretRef.name` | string | Yes | Name of the Secret containing Prism Central credentials | |
| 92 | + |
| 93 | +## Prerequisites |
| 94 | + |
| 95 | +### 1. Prism Central Credentials Secret |
| 96 | + |
| 97 | +Create a secret containing Prism Central credentials: |
| 98 | + |
| 99 | +```yaml |
| 100 | +apiVersion: v1 |
| 101 | +kind: Secret |
| 102 | +metadata: |
| 103 | + name: prism-central-credentials-for-konnector-agent |
| 104 | + namespace: default |
| 105 | +type: Opaque |
| 106 | +stringData: |
| 107 | + username: admin |
| 108 | + password: password |
| 109 | +``` |
| 110 | + |
| 111 | +## Examples |
| 112 | + |
| 113 | +### Minimal Configuration |
| 114 | + |
| 115 | +```yaml |
| 116 | +apiVersion: cluster.x-k8s.io/v1beta1 |
| 117 | +kind: Cluster |
| 118 | +metadata: |
| 119 | + name: minimal-cluster |
| 120 | +spec: |
| 121 | + topology: |
| 122 | + variables: |
| 123 | + - name: clusterConfig |
| 124 | + value: |
| 125 | + addons: |
| 126 | + konnectorAgent: {} |
| 127 | +``` |
| 128 | + |
| 129 | +### With Custom Credentials |
| 130 | + |
| 131 | +```yaml |
| 132 | +apiVersion: cluster.x-k8s.io/v1beta1 |
| 133 | +kind: Cluster |
| 134 | +metadata: |
| 135 | + name: custom-credentials-cluster |
| 136 | +spec: |
| 137 | + topology: |
| 138 | + variables: |
| 139 | + - name: clusterConfig |
| 140 | + value: |
| 141 | + addons: |
| 142 | + konnectorAgent: |
| 143 | + strategy: HelmAddon |
| 144 | + credentials: |
| 145 | + secretRef: |
| 146 | + name: prism-central-credentials-for-konnector-agent |
| 147 | +``` |
| 148 | + |
| 149 | +## Default Values |
| 150 | + |
| 151 | +The addon uses the following default values: |
| 152 | + |
| 153 | +- **Helm Release Name**: `konnector-agent` |
| 154 | +- **Namespace**: `ntnx-system` |
| 155 | +- **Agent Name**: `konnector-agent` |
| 156 | +- **Strategy**: `HelmAddon` |
| 157 | +- **Chart**: `konnector-agent` |
| 158 | +- **Version**: `1.3.0-rc.0` |
| 159 | + |
| 160 | +## Troubleshooting |
| 161 | + |
| 162 | +### Common Issues |
| 163 | + |
| 164 | +1. **Missing Credentials Secret** |
| 165 | + - Ensure the secret exists in the management cluster |
| 166 | + - Verify the secret name matches the configuration |
| 167 | + |
| 168 | +2. **Prism Central Connectivity** |
| 169 | + - Check network connectivity between the cluster and Prism Central |
| 170 | + - Verify the Prism Central endpoint is correct |
| 171 | + - Ensure credentials are valid |
| 172 | + |
| 173 | +3. **Helm Chart Issues** |
| 174 | + - Check the Helm repository is accessible |
| 175 | + - Verify the chart version exists |
| 176 | + - Review HelmChartProxy status |
| 177 | + |
| 178 | +### Monitoring |
| 179 | + |
| 180 | +Monitor the Konnector Agent deployment: |
| 181 | + |
| 182 | +```bash |
| 183 | +# Check HelmChartProxy status |
| 184 | +kubectl get helmchartproxy -A |
| 185 | +
|
| 186 | +# Check agent logs |
| 187 | +kubectl logs hook-preinstall -n ntnx-system |
| 188 | +``` |
| 189 | + |
| 190 | +## References |
| 191 | + |
| 192 | +- [Konnector Agent Repository](https://github.com/nutanix-core/k8s-agent) |
| 193 | +- [Cluster API Add-on Provider for Helm](https://github.com/kubernetes-sigs/cluster-api-addon-provider-helm) |
| 194 | +- [Cluster API Runtime Hooks](https://cluster-api.sigs.k8s.io/tasks/experimental-features/runtime-sdk/hooks.html) |
0 commit comments