Skip to content

Commit 76b6190

Browse files
committed
Add loadBalancerClass field to ListenerClass.spec
See stackabletech/listener-operator#285
1 parent a6d8db5 commit 76b6190

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

crates/stackable-operator/src/commons/listener.rs

+19
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,21 @@ use crate::builder::pod::volume::ListenerOperatorVolumeSourceBuilder;
5151
pub struct ListenerClassSpec {
5252
pub service_type: ServiceType,
5353

54+
/// Configures whether a LoadBalancer service should also allocate node ports (like NodePort).
55+
///
56+
/// Ignored unless serviceType is LoadBalancer.
57+
// TODO: v1alpha2: Move into ServiceType::LoadBalancer
58+
#[serde(default = "ListenerClassSpec::default_load_balancer_allocate_node_ports")]
59+
pub load_balancer_allocate_node_ports: bool,
60+
61+
/// Configures a custom Service loadBalancerClass, which can be used to access secondary
62+
/// load balancer controllers that are installed in the cluster, or to provision
63+
/// custom addresses manually.
64+
///
65+
/// Ignored unless serviceType is LoadBalancer.
66+
// TODO: v1alpha2: Move into ServiceType::LoadBalancer
67+
pub load_balancer_class: Option<String>,
68+
5469
/// Annotations that should be added to the Service object.
5570
#[serde(default)]
5671
pub service_annotations: BTreeMap<String, String>,
@@ -82,6 +97,10 @@ impl ListenerClassSpec {
8297
PreferredAddressType::HostnameConservative
8398
}
8499

100+
const fn default_load_balancer_allocate_node_ports() -> bool {
101+
true
102+
}
103+
85104
/// Resolves [`Self::preferred_address_type`]'s "smart" modes depending on the rest of `self`.
86105
pub fn resolve_preferred_address_type(&self) -> AddressType {
87106
self.preferred_address_type.resolve(self)

0 commit comments

Comments
 (0)