Skip to content

Commit 17d9652

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 dddd78f commit 17d9652

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

crates/stackable-operator/CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ 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
### Changed
812

913
- BREAKING: Version common CRD structs and enums ([#968]).
@@ -18,6 +22,7 @@ All notable changes to this project will be documented in this file.
1822
- Re-export versioned common CRD enums ([#1029]).
1923

2024
[#968]: https://github.com/stackabletech/operator-rs/pull/968
25+
[#986]: https://github.com/stackabletech/operator-rs/pull/986
2126
[#1025]: https://github.com/stackabletech/operator-rs/pull/1025
2227
[#1029]: https://github.com/stackabletech/operator-rs/pull/1029
2328

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

+15
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

+4
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)