@@ -25,8 +25,11 @@ import (
25
25
26
26
"github.com/rs/zerolog/log"
27
27
"github.com/spf13/cobra"
28
+ "google.golang.org/grpc"
28
29
30
+ pbShutdown "github.com/arangodb/kube-arangodb/pkg/api/shutdown/v1"
29
31
"github.com/arangodb/kube-arangodb/pkg/ml/storage"
32
+ "github.com/arangodb/kube-arangodb/pkg/util/probe"
30
33
"github.com/arangodb/kube-arangodb/pkg/util/shutdown"
31
34
"github.com/arangodb/kube-arangodb/pkg/util/svc"
32
35
)
49
52
storage.ServiceConfig
50
53
}
51
54
52
- cmdMLShutdownOptions struct {
53
- shutdown. ServiceConfig
55
+ cmdMLStorageControllerOptions struct {
56
+ svc. GRPCConfig
54
57
}
55
58
)
56
59
@@ -59,7 +62,7 @@ func init() {
59
62
cmdMLStorage .AddCommand (cmdMLStorageS3 )
60
63
61
64
f := cmdMLStorageS3 .PersistentFlags ()
62
- f .StringVar (& cmdMLShutdownOptions .ListenAddress , "shutdown .address" , "" , "Address the GRPC shutdown service will listen on (IP:port)" )
65
+ f .StringVar (& cmdMLStorageControllerOptions .ListenAddress , "controller .address" , "" , "Address the GRPC controller service will listen on (IP:port)" )
63
66
f .StringVar (& cmdMLStorageS3Options .ListenAddress , "server.address" , "" , "Address the GRPC service will listen on (IP:port)" )
64
67
65
68
f .StringVar (& cmdMLStorageS3Options .S3 .Endpoint , "s3.endpoint" , "" , "Endpoint of S3 API implementation" )
@@ -81,10 +84,16 @@ func cmdMLStorageS3Run(cmd *cobra.Command, _ []string) {
81
84
}
82
85
83
86
func cmdMLStorageS3RunE (_ * cobra.Command ) error {
84
- service , err := storage .NewService (shutdown .Context (), storage .StorageTypeS3Proxy , cmdMLStorageS3Options .ServiceConfig )
87
+ storageService , err := storage .NewService (shutdown .Context (), storage .StorageTypeS3Proxy , cmdMLStorageS3Options .ServiceConfig )
85
88
if err != nil {
86
89
return err
87
90
}
88
91
89
- return svc .RunServices (shutdown .Context (), service , shutdown .ServiceCentral (cmdMLShutdownOptions .ServiceConfig ))
92
+ healthService := probe .NewHealthService ()
93
+
94
+ controllerService := svc .NewGRPC (cmdMLStorageControllerOptions .GRPCConfig , func (server * grpc.Server ) {
95
+ pbShutdown .RegisterShutdownServer (server , shutdown .NewShutdownableShutdownServer ())
96
+ healthService .Register (server )
97
+ })
98
+ return svc .RunServices (shutdown .Context (), healthService , storageService , controllerService )
90
99
}
0 commit comments