@@ -51,6 +51,21 @@ use crate::builder::pod::volume::ListenerOperatorVolumeSourceBuilder;
5151pub struct ListenerClassSpec {
5252 pub service_type : ServiceType ,
5353
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+
5469 /// Annotations that should be added to the Service object.
5570 #[ serde( default ) ]
5671 pub service_annotations : BTreeMap < String , String > ,
@@ -82,6 +97,10 @@ impl ListenerClassSpec {
8297 PreferredAddressType :: HostnameConservative
8398 }
8499
100+ const fn default_load_balancer_allocate_node_ports ( ) -> bool {
101+ true
102+ }
103+
85104 /// Resolves [`Self::preferred_address_type`]'s "smart" modes depending on the rest of `self`.
86105 pub fn resolve_preferred_address_type ( & self ) -> AddressType {
87106 self . preferred_address_type . resolve ( self )
0 commit comments