Skip to content

Commit 213e386

Browse files
vijayaraghavanr31manoj-nutanixdkoshkin
authored
Vijayr/109585 k8sagent addon 3 backup (#1373)
**What problem does this PR solve?**: **Which issue(s) this PR fixes**: Fixes # **How Has This Been Tested?**: <!-- Please describe the tests that you ran to verify your changes. Provide output from the tests and any manual steps needed to replicate the tests. --> **Special notes for your reviewer**: <!-- Use this to provide any additional information to the reviewers. This may include: - Best way to review the PR. - Where the author wants the most review attention on. - etc. --> --------- Co-authored-by: Manoj Surudwad <[email protected]> Co-authored-by: Dimitri Koshkin <[email protected]>
1 parent 53680cf commit 213e386

File tree

33 files changed

+1625
-0
lines changed

33 files changed

+1625
-0
lines changed

api/v1alpha1/addon_types.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ type NutanixAddons struct {
9090

9191
// +kubebuilder:validation:Optional
9292
COSI *NutanixCOSI `json:"cosi,omitempty"`
93+
94+
// +kubebuilder:validation:Optional
95+
KonnectorAgent *NutanixKonnectorAgent `json:"konnectorAgent,omitempty"`
9396
}
9497

9598
type GenericAddons struct {
@@ -371,3 +374,15 @@ type Ingress struct {
371374
// +kubebuilder:validation:Enum="aws-lb-controller"
372375
Provider string `json:"provider"`
373376
}
377+
378+
type NutanixKonnectorAgent struct {
379+
// A reference to the Secret for credential information for the target Prism Central instance
380+
// +kubebuilder:validation:Optional
381+
Credentials *NutanixKonnectorAgentCredentials `json:"credentials,omitempty"`
382+
}
383+
384+
type NutanixKonnectorAgentCredentials struct {
385+
// A reference to the Secret containing the credentials used by the Konnector agent.
386+
// +kubebuilder:validation:Required
387+
SecretRef LocalObjectReference `json:"secretRef"`
388+
}

api/v1alpha1/constants.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ const (
3232
ServiceLoadBalancerVariableName = "serviceLoadBalancer"
3333
// RegistryAddonVariableName is the OCI registry config patch variable name.
3434
RegistryAddonVariableName = "registry"
35+
// KonnectorAgentVariableName is the Nutanix konnector-agent addon config patch variable name.
36+
KonnectorAgentVariableName = "konnectorAgent"
3537

3638
// GlobalMirrorVariableName is the global image registry mirror patch variable name.
3739
GlobalMirrorVariableName = "globalImageRegistryMirror"

api/v1alpha1/crds/caren.nutanix.com_nutanixclusterconfigs.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,28 @@ spec:
235235
- defaultStorage
236236
- providers
237237
type: object
238+
konnectorAgent:
239+
properties:
240+
credentials:
241+
description: A reference to the Secret for credential information for the target Prism Central instance
242+
properties:
243+
secretRef:
244+
description: A reference to the Secret containing the credentials used by the Konnector agent.
245+
properties:
246+
name:
247+
description: |-
248+
Name of the referent.
249+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
250+
maxLength: 253
251+
minLength: 1
252+
type: string
253+
required:
254+
- name
255+
type: object
256+
required:
257+
- secretRef
258+
type: object
259+
type: object
238260
nfd:
239261
description: NFD tells us to enable or disable the node feature discovery addon.
240262
properties:

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/variables/aggregate_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ type Addons struct {
6868
COSI *COSI `json:"cosi,omitempty"`
6969

7070
Ingress *Ingress `json:"ingress,omitempty"`
71+
72+
NutanixKonnectorAgent *NutanixKonnectorAgent `json:"konnectorAgent,omitempty"`
73+
}
74+
75+
type NutanixKonnectorAgent struct {
76+
carenv1.NutanixKonnectorAgent `json:",inline"`
7177
}
7278

7379
type CSI struct {

charts/cluster-api-runtime-extensions-nutanix/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ A Helm chart for cluster-api-runtime-extensions-nutanix
9292
| hooks.csi.snapshot-controller.helmAddonStrategy.defaultValueTemplateConfigMap.name | string | `"default-snapshot-controller-helm-values-template"` | |
9393
| hooks.ingress.awsLoadBalancerController.defaultValueTemplateConfigMap.create | bool | `true` | |
9494
| hooks.ingress.awsLoadBalancerController.defaultValueTemplateConfigMap.name | string | `"default-aws-load-balancer-controller-helm-values-template"` | |
95+
| hooks.konnectorAgent.helmAddonStrategy.defaultValueTemplateConfigMap.create | bool | `true` | |
96+
| hooks.konnectorAgent.helmAddonStrategy.defaultValueTemplateConfigMap.name | string | `"default-konnector-agent-helm-values-template"` | |
9597
| hooks.nfd.crsStrategy.defaultInstallationConfigMap.name | string | `"node-feature-discovery"` | |
9698
| hooks.nfd.helmAddonStrategy.defaultValueTemplateConfigMap.create | bool | `true` | |
9799
| hooks.nfd.helmAddonStrategy.defaultValueTemplateConfigMap.name | string | `"default-nfd-helm-values-template"` | |
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
agent:
2+
name: {{ .AgentName }}
3+
image:
4+
repository: quay.io/karbon
5+
name: k8s-agent
6+
pc:
7+
port: {{ .PrismCentralPort }}
8+
insecure: {{ .PrismCentralInsecure }} #set this to true if PC does not have https enabled
9+
endpoint: {{ .PrismCentralHost }} # eg: ip or fqdn
10+
k8sClusterName: {{ .ClusterName }}
11+
k8sDistribution: NKP
12+
createSecret: false

charts/cluster-api-runtime-extensions-nutanix/templates/deployment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ spec:
4545
- --csi.snapshot-controller.helm-addon.default-values-template-configmap-name={{ (index .Values.hooks.csi "snapshot-controller").helmAddonStrategy.defaultValueTemplateConfigMap.name }}
4646
- --ccm.aws.helm-addon.default-values-template-configmap-name={{ .Values.hooks.ccm.aws.helmAddonStrategy.defaultValueTemplateConfigMap.name }}
4747
- --cosi.controller.helm-addon.default-values-template-configmap-name={{ .Values.hooks.cosi.controller.helmAddonStrategy.defaultValueTemplateConfigMap.name }}
48+
- --konnector-agent.helm-addon.default-values-template-configmap-name={{ .Values.hooks.konnectorAgent.helmAddonStrategy.defaultValueTemplateConfigMap.name }}
4849
{{- range $k, $v := .Values.hooks.ccm.aws.k8sMinorVersionToCCMVersion }}
4950
- --ccm.aws.aws-ccm-versions={{ $k }}={{ $v }}
5051
{{- end }}

charts/cluster-api-runtime-extensions-nutanix/templates/helm-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ data:
3535
ChartName: cosi
3636
ChartVersion: 0.0.1-alpha.5
3737
RepositoryURL: '{{ if .Values.helmRepository.enabled }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://mesosphere.github.io/charts/stable/{{ end }}'
38+
konnector-agent: |
39+
ChartName: konnector-agent
40+
ChartVersion: 1.3.0-rc.1
41+
RepositoryURL: '{{ if .Values.helmRepository.enabled }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://mesosphere.github.io/charts/stable{{ end }}'
3842
local-path-provisioner-csi: |
3943
ChartName: local-path-provisioner
4044
ChartVersion: 0.0.32
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright 2025 Nutanix. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
{{- if .Values.hooks.konnectorAgent.helmAddonStrategy.defaultValueTemplateConfigMap.name }}
5+
apiVersion: v1
6+
kind: ConfigMap
7+
metadata:
8+
name: '{{ .Values.hooks.konnectorAgent.helmAddonStrategy.defaultValueTemplateConfigMap.name }}'
9+
data:
10+
values.yaml: |-
11+
{{- .Files.Get "addons/konnector-agent/values-template.yaml" | nindent 4 }}
12+
{{- end -}}

0 commit comments

Comments
 (0)