Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions crates/stackable-operator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Added

- Added `ListenerClass.spec.loadBalancerClass` field ([#986]).

### Changed

- BREAKING: Version common CRD structs and enums ([#968]).
Expand All @@ -13,6 +17,7 @@ All notable changes to this project will be documented in this file.
- Import are now more granular in general.

[#968]: https://github.com/stackabletech/operator-rs/pull/968
[#986]: https://github.com/stackabletech/operator-rs/pull/986

## [0.92.0] - 2025-04-14

Expand Down
15 changes: 15 additions & 0 deletions crates/stackable-operator/src/crd/listener/class/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@ pub mod versioned {
pub struct ListenerClassSpec {
pub service_type: core_v1alpha1::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<String>,

/// Annotations that should be added to the Service object.
#[serde(default)]
pub service_annotations: BTreeMap<String, String>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ impl ListenerClassSpec {
PreferredAddressType::HostnameConservative
}

pub(super) 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)
Expand Down