gadget-container: Add support for liveness probe on GadgetTracerManager
This commit uses the grpc_health_v1 package to exposes the
GadgetTracerManager's health to be used by the Kubernetes liveness probe.
It does not register a specific service but uses the default one
that is automatically set to SERVING status.
This set of commits fix
@@ -25,6 +25,8 @@ import (
"time"
"google.golang.org/grpc"
+ "google.golang.org/grpc/health"
+ healthpb "google.golang.org/grpc/health/grpc_health_v1"
"github.com/kinvolk/inspektor-gadget/pkg/gadgettracermanager"
pb "github.com/kinvolk/inspektor-gadget/pkg/gadgettracermanager/api"
@@ -198,6 +200,10 @@ func main() {
}
pb.RegisterGadgetTracerManagerServer(grpcServer, tracerManager)
+
+ healthserver := health.NewServer()
+ healthpb.RegisterHealthServer(grpcServer, healthserver)
+
grpcServer.Serve(lis)
}
}
