From 76b61900b7348df4da8210061efd18c28d99fb76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Natalie=20Klestrup=20R=C3=B6ijezon?= Date: Wed, 19 Mar 2025 12:00:16 +0100 Subject: [PATCH 1/2] Add loadBalancerClass field to ListenerClass.spec See https://github.com/stackabletech/listener-operator/issues/285 --- .../src/commons/listener.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/crates/stackable-operator/src/commons/listener.rs b/crates/stackable-operator/src/commons/listener.rs index b088e3950..4b666fbf1 100644 --- a/crates/stackable-operator/src/commons/listener.rs +++ b/crates/stackable-operator/src/commons/listener.rs @@ -51,6 +51,21 @@ use crate::builder::pod::volume::ListenerOperatorVolumeSourceBuilder; pub struct ListenerClassSpec { pub service_type: ServiceType, + /// Configures whether a LoadBalancer service should also allocate node ports (like NodePort). + /// + /// Ignored unless serviceType is LoadBalancer. + // TODO: v1alpha2: Move into ServiceType::LoadBalancer + #[serde(default = "ListenerClassSpec::default_load_balancer_allocate_node_ports")] + pub load_balancer_allocate_node_ports: bool, + + /// Configures a custom Service loadBalancerClass, which can be used to access secondary + /// load balancer controllers that are installed in the cluster, or to provision + /// custom addresses manually. + /// + /// Ignored unless serviceType is LoadBalancer. + // TODO: v1alpha2: Move into ServiceType::LoadBalancer + pub load_balancer_class: Option, + /// Annotations that should be added to the Service object. #[serde(default)] pub service_annotations: BTreeMap, @@ -82,6 +97,10 @@ impl ListenerClassSpec { PreferredAddressType::HostnameConservative } + const fn default_load_balancer_allocate_node_ports() -> bool { + true + } + /// Resolves [`Self::preferred_address_type`]'s "smart" modes depending on the rest of `self`. pub fn resolve_preferred_address_type(&self) -> AddressType { self.preferred_address_type.resolve(self) From 858c6fcb6bac0b8a384087d489e4aaffae25c924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Natalie=20Klestrup=20R=C3=B6ijezon?= Date: Wed, 19 Mar 2025 12:05:18 +0100 Subject: [PATCH 2/2] Changelog --- crates/stackable-operator/CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/stackable-operator/CHANGELOG.md b/crates/stackable-operator/CHANGELOG.md index ff1f57902..c1f59d25a 100644 --- a/crates/stackable-operator/CHANGELOG.md +++ b/crates/stackable-operator/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +### Added + +- Added `ListenerClass.spec.loadBalancerClass` field ([#986]). + +[#986]: https://github.com/stackabletech/operator-rs/pull/986 + ## [0.87.4] - 2025-03-17 ## [0.87.3] - 2025-03-14