Skip to content

Commit 687eec2

Browse files
committed
fix: support AWS clusters in AWS LB Controller
1 parent 2362c52 commit 687eec2

File tree

2 files changed

+10
-2
lines changed
  • charts/cluster-api-runtime-extensions-nutanix/addons/aws-load-balancer-controller
  • pkg/handlers/lifecycle/awsloadbalancercontroller

2 files changed

+10
-2
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1+
# The clusterName refers the kubernetes.io/cluster/ tag on AWS resources.
2+
# For EKS clusters, the name will be based on the cluster's namespace + a random suffix.
3+
# For AWS clusters, the name will just be based on the cluster name.
4+
{{- $capiProvider := index .Cluster.metadata.labels "cluster.x-k8s.io/provider" }}
5+
{{- if eq $capiProvider "eks" }}
16
clusterName: "{{ .ControlPlane.spec.eksClusterName }}"
7+
{{- else }}
8+
clusterName: "{{ .Cluster.metadata.name }}"
9+
{{- end }}

pkg/handlers/lifecycle/awsloadbalancercontroller/handler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ func (n *DefaultAWSLoadBalancerController) apply(
118118

119119
// For now, always enable the AWS Load Balancer Controller
120120
// FIXME: Add proper variable checking when APIs are added
121-
if provider := utils.GetProvider(cluster); provider != "eks" {
122-
log.V(5).Info("Skipping AWS Load Balancer Controller handler,not an EKS cluster", provider)
121+
if provider := utils.GetProvider(cluster); provider != "eks" && provider != "aws" {
122+
log.V(5).Info("Skipping AWS Load Balancer Controller handler, not an EKS or AWS cluster", provider)
123123
return
124124
}
125125

0 commit comments

Comments
 (0)