kubernetes-sigs / cluster-api-provider-aws

Kubernetes Cluster API Provider AWS provides consistent deployment and day 2 operations of "self-managed" and EKS Kubernetes clusters on AWS.
http://cluster-api-aws.sigs.k8s.io/
Apache License 2.0
646 stars 571 forks source link

Add an ability to disable/adopt LoadBalancer #5130

Open a13x5 opened 1 month ago

a13x5 commented 1 month ago

/kind feature

The problem

Currently when reconciling AWSCluster all resources needed for cluster to function are created. This works well when you have all nodes as instances. However this approach doesn't quite work when you have control plane inside kubernetes cluster (like in case of k0sproject/k0smotron).

When load balancer is managed externally it creates a conflict:

Since it's impossible to use CAPA without creating AWSCluster current work around is to put cluster.x-k8s.io/managed-by annotation and disable AWSCluster reconcile, which is suboptimal.

Desired solution

I see 2 ways to resolve this:

  1. New id field is added to the AWSLoadBalancerSpec with an ability to adopt externally created LBs and thus skipping creation of the new LB.
  2. New disableCreation field is added to the AWSLoadBalancerSpec which simply disables creation of LB completely.

This will allow to use CAPA in deployment scenarios where LB is managed externally.

k8s-ci-robot commented 1 month ago

This issue is currently awaiting triage.

If CAPA/CAPI contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.