Skip to content

Commit 0bf652e

Browse files
committed
build: include AWS Load Balancer controller in Helm chart
1 parent 1961ebf commit 0bf652e

File tree

8 files changed

+68
-0
lines changed

8 files changed

+68
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
clusterName: "{{ .ControlPlane.spec.eksClusterName }}"
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.addons.awsLoadBalancerController.defaultValueTemplateConfigMap.create }}
5+
apiVersion: v1
6+
kind: ConfigMap
7+
metadata:
8+
name: '{{ .Values.hooks.addons.awsLoadBalancerController.defaultValueTemplateConfigMap.name }}'
9+
data:
10+
values.yaml: |-
11+
{{- .Files.Get "addons/aws-load-balancer-controller/values-template.yaml" | nindent 4 }}
12+
{{- 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
@@ -15,6 +15,10 @@ data:
1515
ChartName: aws-ebs-csi-driver
1616
ChartVersion: 2.48.0
1717
RepositoryURL: '{{ if .Values.helmRepository.enabled }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://kubernetes-sigs.github.io/aws-ebs-csi-driver{{ end }}'
18+
aws-load-balancer-controller: |
19+
ChartName: aws-load-balancer-controller
20+
ChartVersion: 1.13.4
21+
RepositoryURL: '{{ if .Values.helmRepository.enabled }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://aws.github.io/eks-charts{{ end }}'
1822
cilium: |
1923
ChartName: cilium
2024
ChartVersion: 1.18.2

charts/cluster-api-runtime-extensions-nutanix/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ hooks:
117117
create: true
118118
name: default-registry-syncer-helm-values-template
119119

120+
addons:
121+
awsLoadBalancerController:
122+
defaultValueTemplateConfigMap:
123+
create: true
124+
name: default-aws-load-balancer-controller-helm-values-template
125+
120126
helmAddonsConfigMap: default-helm-addons-config
121127

122128
deployDefaultClusterClasses: true

hack/addons/helm-chart-bundler/repos.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ repositories:
1616
charts:
1717
aws-ebs-csi-driver:
1818
- 2.48.0
19+
aws-load-balancer-controller:
20+
repoURL: https://aws.github.io/eks-charts
21+
charts:
22+
aws-load-balancer-controller:
23+
- 1.13.4
1924
cilium:
2025
repoURL: https://helm.cilium.io/
2126
charts:
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright 2025 Nutanix. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
apiVersion: kustomize.config.k8s.io/v1beta1
5+
kind: Kustomization
6+
7+
metadata:
8+
name: aws-load-balancer-controller
9+
10+
helmCharts:
11+
- name: aws-load-balancer-controller
12+
namespace: kube-system
13+
repo: https://aws.github.io/eks-charts
14+
releaseName: aws-load-balancer-controller
15+
version: ${AWS_LOAD_BALANCER_CONTROLLER_CHART_VERSION}
16+
includeCRDs: true
17+
skipTests: true

hack/tools/fetch-images/main.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,27 @@ func getValuesFileForChartIfNeeded(chartName, carenChartDirectory string) (strin
381381
return "", fmt.Errorf("failed to execute helm values template %w", err)
382382
}
383383

384+
return tempFile.Name(), nil
385+
case "aws-load-balancer-controller":
386+
f := filepath.Join(carenChartDirectory, "addons", "aws-load-balancer-controller", defaultHelmAddonFilename)
387+
tempFile, err := os.CreateTemp("", "")
388+
if err != nil {
389+
return "", fmt.Errorf("failed to create temp file: %w", err)
390+
}
391+
392+
templateInput := map[string]interface{}{
393+
"InfraCluster": map[string]interface{}{
394+
"spec": map[string]interface{}{
395+
"eksClusterName": "tmplCluster",
396+
},
397+
},
398+
}
399+
400+
err = template.Must(template.New(defaultHelmAddonFilename).ParseFiles(f)).Execute(tempFile, &templateInput)
401+
if err != nil {
402+
return "", fmt.Errorf("failed to execute helm values template %w", err)
403+
}
404+
384405
return tempFile.Name(), nil
385406
default:
386407
return "", nil

make/addons.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ export AWS_CCM_VERSION_131 := v1.31.5
1818
export AWS_CCM_VERSION_132 := v1.32.1
1919
export AWS_CCM_VERSION_133 := v1.33.0
2020

21+
export AWS_LOAD_BALANCER_CONTROLLER_CHART_VERSION := 1.13.4
22+
2123
export NUTANIX_CCM_CHART_VERSION := 0.5.2
2224

2325
export KUBE_VIP_VERSION := v0.9.1

0 commit comments

Comments
 (0)