pub fn build_broker_role_service(kafka: &KafkaCluster) -> Result<Service> {
    let role_name = KafkaRole::Broker.to_string();
    let role_svc_name = kafka
        .broker_role_service_name()
        .context(GlobalServiceNameNotFoundSnafu)?;
    Ok(Service {
        metadata: ObjectMetaBuilder::new()
            .name_and_namespace(kafka)
            .name(&role_svc_name)
            .ownerreference_from_resource(kafka, None, Some(true))
            .context(ObjectMissingMetadataForOwnerRefSnafu)?
            .with_recommended_labels(kafka, APP_NAME, kafka_version(kafka)?, &role_name, "global")
            .build(),
        spec: Some(ServiceSpec {
            ports: Some(vec![ServicePort {
                name: Some("kafka".to_string()),
                port: APP_PORT.into(),
                protocol: Some("TCP".to_string()),
                ..ServicePort::default()
            }]),
            selector: Some(role_selector_labels(kafka, APP_NAME, &role_name)),
            type_: Some("NodePort".to_string()),
            ..ServiceSpec::default()
        }),
        status: None,
    })
}
/// The broker-role service is the primary endpoint that should be used by clients that do not perform internal load balancing,
/// including targets outside of the cluster.
The broker-role service is the primary endpoint that should be used by clients that do not perform internal load balancing,
including targets outside of the cluster.
The broker - role service is the primary endpoint that should be used by clients that do not perform internal load balancing including targets outside of the cluster .
pub fn build_broker_role_service(kafka: &KafkaCluster) -> Result<Service> {
    let role_name = KafkaRole::Broker.to_string();
    let role_svc_name = kafka
        .broker_role_service_name()
        .context(GlobalServiceNameNotFoundSnafu)?;
    Ok(Service {
        metadata: ObjectMetaBuilder::new()
            .name_and_namespace(kafka)
            .name(&role_svc_name)
            .ownerreference_from_resource(kafka, None, Some(true))
            .context(ObjectMissingMetadataForOwnerRefSnafu)?
            .with_recommended_labels(kafka, APP_NAME, kafka_version(kafka)?, &role_name, "global")
            .build(),
        spec: Some(ServiceSpec {
            ports: Some(vec![ServicePort {
                name: Some("kafka".to_string()),
                port: APP_PORT.into(),
                protocol: Some("TCP".to_string()),
                ..ServicePort::default()
            }]),
            selector: Some(role_selector_labels(kafka, APP_NAME, &role_name)),
            type_: Some("NodePort".to_string()),
            ..ServiceSpec::default()
        }),
        status: None,
    })
}
pub fn build_broker_role_service ( kafka : & KafkaCluster ) -> Result < Service > { let role_name = KafkaRole :: Broker . to_string ( ) ; let role_svc_name = kafka . broker_role_service_name ( ) . context ( GlobalServiceNameNotFoundSnafu ) ? ; Ok ( Service { metadata : ObjectMetaBuilder :: new ( ) . name_and_namespace ( kafka ) . name ( & role_svc_name ) . ownerreference_from_resource ( kafka , None , Some ( true ) ) . context ( ObjectMissingMetadataForOwnerRefSnafu ) ? . with_recommended_labels ( kafka , APP_NAME , kafka_version ( kafka ) ? , & role_name , " " ) . build ( ) , spec : Some ( ServiceSpec { ports : Some ( vec ! [ ServicePort { name Some ( " " to_string ( ) ) port APP_PORT into ( ) protocol Some ( " " to_string ( ) ) ServicePort default ( ) } ] ) , selector : Some ( role_selector_labels ( kafka , APP_NAME , & role_name ) ) , type_ : Some ( " " . to_string ( ) ) , .. ServiceSpec :: default ( ) } ) , status : None , } ) }
The broker-role service is the primary endpoint that should be used by clients that do not perform internal load balancing,
including targets outside of the cluster.
The broker - role service is the primary endpoint that should be used by clients that do not perform internal load balancing including targets outside of the cluster .
kafka
&KafkaCluster
kafka
&KafkaCluster