Skip to content

Add native support for gRPC health check #1514

@cagecurrent

Description

@cagecurrent

Is your feature request related to a problem? Please describe.

I'm trying to setup a gRPC proxy as a front-end to our Kafka server to be able to access it using gRPC (which we already widely use). This Zilla-based proxy I will deploy in a Kubernetes cluster. This cluster however requires me to have a health end-point, and in the case of being configured for gRPC it needs to implement the standard gRPC health check protocol. And if my proxy does not answer with SERVING the pod will be taken down.

When running locally I use the grpc-health-probe tool, and I believe this is fully compatible with how the Kubernetes gRPC health-check works.

https://github.com/grpc-ecosystem/grpc-health-probe

The incoming request looks like this:

/grpc.health.v1.Health/Check

The messages for the request and response in the proto looks like this:

message HealthCheckRequest {
  string service = 1;
}

message HealthCheckResponse {
  enum ServingStatus {
    UNKNOWN = 0;
    SERVING = 1;
    NOT_SERVING = 2;
    SERVICE_UNKNOWN = 3;  // Used only by the Watch method.
  }
  ServingStatus status = 1;
}

Describe the solution you'd like

Ideally I would like to see native, built-in support for the gRPC health-check. For me it's enough to have it statically answer SERVING as long as Zilla is running properly, but others might need to be able to probe some of the upstream services and based on that respond accordingly.

Describe alternatives you've considered

An alternative solution would be that I could add a "direct response" value directly in the zilla.yaml file, telling Zilla to reply with SERVING. Something similar to config snippets below.

north_http_server:
    type: http
    kind: server
    routes:
      - when:
          - headers:
              :path: /grpc.health.v1.Health/*
        exit: north_health_server
north_health_server:
   type: direct_response   
   kind: server
   options:
      response:
          value: 'SERVING'
          code: 200

Having a way to specify direct response in a straight-forward way like this would actually be really useful. But maybe it can already be accomplished using catalogs?!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions