Skip to content

Support externally managed load-balancer for DockerCluster #13224

@phoban01

Description

@phoban01

What would you like to be added (User Story)?

As a developer of pod-based control-plane providers I would like to use the docker infrastructure provider for testing and development. I will provide my own load-balancer for the control-plane and therefore I require the ability to skip provisioning the DockerCluster load-balancer.

Detailed Description

A new field should be added to the DockerCluster resource:

// DockerLoadBalancer allows defining configurations for the cluster load balancer.
type DockerLoadBalancer struct {
    //...
    // ExternallyManaged indicates the load balancer is managed outside of CAPD.
    // When true, CAPD will not provision a load balancer.
    // +optional
    ExternallyManaged bool `json:"externallyManaged,omitempty"`
}

dockercluster_backend.go should be updated to account for the new field and mark the load-balancer as ready if it is externally managed:

	// Reconcile the external load balancer or mark ready if externally managed
	if !dockerCluster.Spec.Backend.Docker.LoadBalancer.ExternallyManaged {
		if err := r.reconcileLoadBalancer(ctx, cluster, dockerCluster); err != nil {
			return ctrl.Result{}, err
		}
	} else {
		v1beta1conditions.MarkTrue(dockerCluster, infrav1.LoadBalancerAvailableV1Beta1Condition)
		conditions.Set(dockerCluster, metav1.Condition{
			Type:    infrav1.DevClusterDockerLoadBalancerAvailableCondition,
			Status:  metav1.ConditionTrue,
			Reason:  infrav1.DevClusterDockerLoadBalancerAvailableReason,
			Message: "Load balancer is externally managed",
		})
	}

Anything else you would like to add?

In addition to the above changes conversion code will be required.

We've been carrying our own fork for this purpose for over a year and believe it has value for others working on control plane as pods (kamaji, hosted control planes etc...).

Label(s) to be applied

/kind feature
/area provider/infrastructure-docker

Metadata

Metadata

Assignees

Labels

area/provider/infrastructure-dockerIssues or PRs related to the docker infrastructure providerhelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.priority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to complete.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions