@@ -786,21 +786,7 @@ fn build_server_rolegroup_statefulset(
786786 create_vector_shutdown_file_command( STACKABLE_LOG_DIR ) ,
787787 } ] )
788788 . resources ( merged_config. resources . clone ( ) . into ( ) ) ;
789- let probe = Probe {
790- http_get : Some ( HTTPGetAction {
791- port : IntOrString :: Int ( APP_PORT . into ( ) ) ,
792- path : Some ( "/health" . to_string ( ) ) ,
793- ..HTTPGetAction :: default ( )
794- } ) ,
795- initial_delay_seconds : Some ( 15 ) ,
796- period_seconds : Some ( 15 ) ,
797- timeout_seconds : Some ( 1 ) ,
798- failure_threshold : Some ( 3 ) ,
799- success_threshold : Some ( 1 ) ,
800- ..Probe :: default ( )
801- } ;
802- superset_cb. readiness_probe ( probe. clone ( ) ) ;
803- superset_cb. liveness_probe ( probe) ;
789+ add_superset_container_probes ( & mut superset_cb) ;
804790
805791 // listener endpoints will use persistent volumes
806792 // so that load balancers can hard-code the target addresses and
@@ -932,6 +918,35 @@ fn build_server_rolegroup_statefulset(
932918 } )
933919}
934920
921+ fn add_superset_container_probes ( superset_cb : & mut ContainerBuilder ) {
922+ let probe_action = HTTPGetAction {
923+ port : IntOrString :: Int ( APP_PORT . into ( ) ) ,
924+ path : Some ( "/health" . to_string ( ) ) ,
925+ ..HTTPGetAction :: default ( )
926+ } ;
927+ let common_probe = Probe {
928+ http_get : Some ( probe_action) ,
929+ period_seconds : Some ( 5 ) ,
930+ timeout_seconds : Some ( 5 ) ,
931+ success_threshold : Some ( 1 ) ,
932+ ..Probe :: default ( )
933+ } ;
934+ superset_cb. startup_probe ( Probe {
935+ failure_threshold : Some ( 10 /* minutes */ * 60 / 5 ) ,
936+ ..common_probe. clone ( )
937+ } ) ;
938+ // Remove it from the Service immediately
939+ superset_cb. readiness_probe ( Probe {
940+ failure_threshold : Some ( 1 ) ,
941+ ..common_probe. clone ( )
942+ } ) ;
943+ // But only restart it after 3 failures
944+ superset_cb. readiness_probe ( Probe {
945+ failure_threshold : Some ( 3 ) ,
946+ ..common_probe
947+ } ) ;
948+ }
949+
935950fn add_authentication_volumes_and_volume_mounts (
936951 auth_config : & SupersetClientAuthenticationDetailsResolved ,
937952 cb : & mut ContainerBuilder ,
0 commit comments