@@ -29,9 +29,7 @@ use stackable_operator::{
29
29
DeepMerge ,
30
30
api:: {
31
31
apps:: v1:: { StatefulSet , StatefulSetSpec } ,
32
- core:: v1:: {
33
- ConfigMap , PodSecurityContext , Service , ServiceAccount , ServicePort , ServiceSpec ,
34
- } ,
32
+ core:: v1:: { ConfigMap , PodSecurityContext , ServiceAccount } ,
35
33
rbac:: v1:: { ClusterRole , RoleBinding , RoleRef , Subject } ,
36
34
} ,
37
35
apimachinery:: pkg:: apis:: meta:: v1:: LabelSelector ,
@@ -41,7 +39,7 @@ use stackable_operator::{
41
39
core:: { DeserializeGuard , error_boundary} ,
42
40
runtime:: { controller:: Action , reflector:: ObjectRef } ,
43
41
} ,
44
- kvp:: { Label , Labels , ObjectLabels } ,
42
+ kvp:: { Labels , ObjectLabels } ,
45
43
logging:: controller:: ReconcilerError ,
46
44
product_logging:: {
47
45
framework:: { LoggingError , calculate_log_volume_size_limit, vector_container} ,
@@ -301,13 +299,6 @@ pub async fn reconcile(
301
299
. merged_config ( & rgr)
302
300
. context ( FailedToResolveConfigSnafu ) ?;
303
301
304
- let service =
305
- build_rolegroup_service ( shs, & resolved_product_image. app_version_label , & rgr) ?;
306
- cluster_resources
307
- . add ( client, service)
308
- . await
309
- . context ( ApplyServiceSnafu ) ?;
310
-
311
302
let config_map = build_config_map (
312
303
shs,
313
304
rolegroup_config,
@@ -614,9 +605,9 @@ fn build_stateful_set(
614
605
// so that load balancers can hard-code the target addresses. This will
615
606
// be the case even when no class is set (and the value defaults to
616
607
// cluster-internal) as the address should still be consistent.
617
- let pvcs = Some ( vec ! [
608
+ let volume_claim_templates = Some ( vec ! [
618
609
ListenerOperatorVolumeSourceBuilder :: new(
619
- & ListenerReference :: ListenerClass ( merged_config . listener_class . to_string ( ) ) ,
610
+ & ListenerReference :: ListenerName ( shs . group_listener_name ( rolegroupref ) ) ,
620
611
& recommended_labels,
621
612
)
622
613
. context( BuildListenerVolumeSnafu ) ?
@@ -672,7 +663,7 @@ fn build_stateful_set(
672
663
metadata : sts_metadata,
673
664
spec : Some ( StatefulSetSpec {
674
665
template : pod_template,
675
- volume_claim_templates : pvcs ,
666
+ volume_claim_templates,
676
667
replicas : shs. replicas ( rolegroupref) ,
677
668
selector : LabelSelector {
678
669
match_labels : Some (
@@ -832,58 +823,3 @@ fn cleaner_config(
832
823
833
824
Ok ( result)
834
825
}
835
-
836
- /// The rolegroup [`Service`] is a headless service that allows direct access to the instances of a certain rolegroup
837
- ///
838
- /// This is mostly useful for internal communication between peers, or for clients that perform client-side load balancing.
839
- #[ allow( clippy:: result_large_err) ]
840
- fn build_rolegroup_service (
841
- shs : & v1alpha1:: SparkHistoryServer ,
842
- app_version_label : & str ,
843
- group : & RoleGroupRef < v1alpha1:: SparkHistoryServer > ,
844
- ) -> Result < Service , Error > {
845
- let ports = Some ( vec ! [
846
- ServicePort {
847
- name: Some ( String :: from( "http" ) ) ,
848
- port: HISTORY_UI_PORT . into( ) ,
849
- ..ServicePort :: default ( )
850
- } ,
851
- ServicePort {
852
- name: Some ( String :: from( "metrics" ) ) ,
853
- port: METRICS_PORT . into( ) ,
854
- ..ServicePort :: default ( )
855
- } ,
856
- ] ) ;
857
-
858
- let metadata = ObjectMetaBuilder :: new ( )
859
- . name_and_namespace ( shs)
860
- . name ( group. object_name ( ) )
861
- . ownerreference_from_resource ( shs, None , Some ( true ) )
862
- . context ( ObjectMissingMetadataForOwnerRefSnafu ) ?
863
- . with_recommended_labels ( labels ( shs, app_version_label, & group. role_group ) )
864
- . context ( MetadataBuildSnafu ) ?
865
- . with_label ( Label :: try_from ( ( "prometheus.io/scrape" , "true" ) ) . context ( LabelBuildSnafu ) ?)
866
- . build ( ) ;
867
-
868
- let selector = Some (
869
- Labels :: role_group_selector ( shs, APP_NAME , & group. role , & group. role_group )
870
- . context ( LabelBuildSnafu ) ?
871
- . into ( ) ,
872
- ) ;
873
-
874
- let service_spec = ServiceSpec {
875
- // Internal communication does not need to be exposed
876
- type_ : Some ( "ClusterIP" . to_string ( ) ) ,
877
- cluster_ip : Some ( "None" . to_string ( ) ) ,
878
- ports,
879
- selector,
880
- publish_not_ready_addresses : Some ( true ) ,
881
- ..ServiceSpec :: default ( )
882
- } ;
883
-
884
- Ok ( Service {
885
- metadata,
886
- spec : Some ( service_spec) ,
887
- status : None ,
888
- } )
889
- }
0 commit comments