@@ -51,6 +51,21 @@ use crate::builder::pod::volume::ListenerOperatorVolumeSourceBuilder;
51
51
pub struct ListenerClassSpec {
52
52
pub service_type : ServiceType ,
53
53
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
+
54
69
/// Annotations that should be added to the Service object.
55
70
#[ serde( default ) ]
56
71
pub service_annotations : BTreeMap < String , String > ,
@@ -82,6 +97,10 @@ impl ListenerClassSpec {
82
97
PreferredAddressType :: HostnameConservative
83
98
}
84
99
100
+ const fn default_load_balancer_allocate_node_ports ( ) -> bool {
101
+ true
102
+ }
103
+
85
104
/// Resolves [`Self::preferred_address_type`]'s "smart" modes depending on the rest of `self`.
86
105
pub fn resolve_preferred_address_type ( & self ) -> AddressType {
87
106
self . preferred_address_type . resolve ( self )
0 commit comments