Skip to content

Commit 077302c

Browse files
authored
Add loadBalancerClass field to ListenerClass.spec (#986)
* Add loadBalancerClass field to ListenerClass.spec See stackabletech/listener-operator#285 * Changelog * Mention loadBalancerAllocateNodePorts in the changelog
1 parent bc58ff9 commit 077302c

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

crates/stackable-operator/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
### Added
8+
9+
- Added `ListenerClass.spec.loadBalancerClass` and `.loadBalancerAllocateNodePorts` fields ([#986]).
10+
711
### Removed
812

913
- Remove instrumenation from uninteresting funtions ([#1023]).
1014

15+
[#986]: https://github.com/stackabletech/operator-rs/pull/986
1116
[#1023]: https://github.com/stackabletech/operator-rs/pull/1023
1217

1318
## [0.93.1] - 2025-05-20

crates/stackable-operator/src/crd/listener/class/mod.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,21 @@ pub mod versioned {
3131
pub struct ListenerClassSpec {
3232
pub service_type: core_v1alpha1::ServiceType,
3333

34+
/// Configures whether a LoadBalancer service should also allocate node ports (like NodePort).
35+
///
36+
/// Ignored unless serviceType is LoadBalancer.
37+
// TODO: v1alpha2: Move into ServiceType::LoadBalancer
38+
#[serde(default = "ListenerClassSpec::default_load_balancer_allocate_node_ports")]
39+
pub load_balancer_allocate_node_ports: bool,
40+
41+
/// Configures a custom Service loadBalancerClass, which can be used to access secondary
42+
/// load balancer controllers that are installed in the cluster, or to provision
43+
/// custom addresses manually.
44+
///
45+
/// Ignored unless serviceType is LoadBalancer.
46+
// TODO: v1alpha2: Move into ServiceType::LoadBalancer
47+
pub load_balancer_class: Option<String>,
48+
3449
/// Annotations that should be added to the Service object.
3550
#[serde(default)]
3651
pub service_annotations: BTreeMap<String, String>,

crates/stackable-operator/src/crd/listener/class/v1alpha1_impl.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ impl ListenerClassSpec {
1212
PreferredAddressType::HostnameConservative
1313
}
1414

15+
pub(super) const fn default_load_balancer_allocate_node_ports() -> bool {
16+
true
17+
}
18+
1519
/// Resolves [`Self::preferred_address_type`]'s "smart" modes depending on the rest of `self`.
1620
pub fn resolve_preferred_address_type(&self) -> AddressType {
1721
self.preferred_address_type.resolve(self)

0 commit comments

Comments
 (0)