fn build_broker_rolegroup_service(
    rolegroup: &RoleGroupRef<KafkaCluster>,
    kafka: &KafkaCluster,
) -> Result<Service> {
    Ok(Service {
        metadata: ObjectMetaBuilder::new()
            .name_and_namespace(kafka)
            .name(&rolegroup.object_name())
            .ownerreference_from_resource(kafka, None, Some(true))
            .context(ObjectMissingMetadataForOwnerRefSnafu)?
            .with_recommended_labels(
                kafka,
                APP_NAME,
                kafka_version(kafka)?,
                &rolegroup.role,
                &rolegroup.role_group,
            )
            .with_label("prometheus.io/scrape", "true")
            .build(),
        spec: Some(ServiceSpec {
            cluster_ip: Some("None".to_string()),
            ports: Some(vec![
                ServicePort {
                    name: Some("kafka".to_string()),
                    port: APP_PORT.into(),
                    protocol: Some("TCP".to_string()),
                    ..ServicePort::default()
                },
                ServicePort {
                    name: Some("metrics".to_string()),
                    port: METRICS_PORT.into(),
                    protocol: Some("TCP".to_string()),
                    ..ServicePort::default()
                },
            ]),
            selector: Some(role_group_selector_labels(
                kafka,
                APP_NAME,
                &rolegroup.role,
                &rolegroup.role_group,
            )),
            publish_not_ready_addresses: Some(true),
            ..ServiceSpec::default()
        }),
        status: None,
    })
}
/// The rolegroup [`Service`] is a headless service that allows direct access to the instances of a certain rolegroup
///
/// This is mostly useful for internal communication between peers, or for clients that perform client-side load balancing.
The rolegroup [`Service`] is a headless service that allows direct access to the instances of a certain rolegroup
This is mostly useful for internal communication between peers, or for clients that perform client-side load balancing.
The rolegroup [ ` Service ` ] is a headless service that allows direct access to the instances of a certain rolegroup This is mostly useful for internal communication between peers or for clients that perform client - side load balancing .
fn build_broker_rolegroup_service(
    rolegroup: &RoleGroupRef<KafkaCluster>,
    kafka: &KafkaCluster,
) -> Result<Service> {
    Ok(Service {
        metadata: ObjectMetaBuilder::new()
            .name_and_namespace(kafka)
            .name(&rolegroup.object_name())
            .ownerreference_from_resource(kafka, None, Some(true))
            .context(ObjectMissingMetadataForOwnerRefSnafu)?
            .with_recommended_labels(
                kafka,
                APP_NAME,
                kafka_version(kafka)?,
                &rolegroup.role,
                &rolegroup.role_group,
            )
            .with_label("prometheus.io/scrape", "true")
            .build(),
        spec: Some(ServiceSpec {
            cluster_ip: Some("None".to_string()),
            ports: Some(vec![
                ServicePort {
                    name: Some("kafka".to_string()),
                    port: APP_PORT.into(),
                    protocol: Some("TCP".to_string()),
                    ..ServicePort::default()
                },
                ServicePort {
                    name: Some("metrics".to_string()),
                    port: METRICS_PORT.into(),
                    protocol: Some("TCP".to_string()),
                    ..ServicePort::default()
                },
            ]),
            selector: Some(role_group_selector_labels(
                kafka,
                APP_NAME,
                &rolegroup.role,
                &rolegroup.role_group,
            )),
            publish_not_ready_addresses: Some(true),
            ..ServiceSpec::default()
        }),
        status: None,
    })
}
fn build_broker_rolegroup_service ( rolegroup : & RoleGroupRef < KafkaCluster > , kafka : & KafkaCluster , ) -> Result < Service > { Ok ( Service { metadata : ObjectMetaBuilder :: new ( ) . name_and_namespace ( kafka ) . name ( & rolegroup . object_name ( ) ) . ownerreference_from_resource ( kafka , None , Some ( true ) ) . context ( ObjectMissingMetadataForOwnerRefSnafu ) ? . with_recommended_labels ( kafka , APP_NAME , kafka_version ( kafka ) ? , & rolegroup . role , & rolegroup . role_group , ) . with_label ( " " , " " ) . build ( ) , spec : Some ( ServiceSpec { cluster_ip : Some ( " " . to_string ( ) ) , ports : Some ( vec ! [ ServicePort { name Some ( " " to_string ( ) ) port APP_PORT into ( ) protocol Some ( " " to_string ( ) ) ServicePort default ( ) } ServicePort { name Some ( " " to_string ( ) ) port METRICS_PORT into ( ) protocol Some ( " " to_string ( ) ) ServicePort default ( ) } ] ) , selector : Some ( role_group_selector_labels ( kafka , APP_NAME , & rolegroup . role , & rolegroup . role_group , ) ) , publish_not_ready_addresses : Some ( true ) , .. ServiceSpec :: default ( ) } ) , status : None , } ) }
The rolegroup [`Service`] is a headless service that allows direct access to the instances of a certain rolegroup
This is mostly useful for internal communication between peers, or for clients that perform client-side load balancing.
The rolegroup [ ` Service ` ] is a headless service that allows direct access to the instances of a certain rolegroup This is mostly useful for internal communication between peers or for clients that perform client - side load balancing .
rolegroup
&RoleGroupRef<KafkaCluster>
kafka
&KafkaCluster
rolegroup
&RoleGroupRef<KafkaCluster>
kafka
&KafkaCluster