kubernetes-ingress icon indicating copy to clipboard operation
kubernetes-ingress copied to clipboard

gRPC health checks creation

Open jasonwilliams14 opened this issue 1 year ago • 3 comments

When creating a gRPC health check for NGINX Ingress controller, the NGINX .conf being generated is incorrect. Snippet from the error log:

[emerg] 320#320: invalid grpc parameter \"keepalive_time=60s\" in /etc/nginx/conf.d/vs_default_virtual-server.conf:132\n"

This is occuring when you specify the type: grpc in active health check section, or use grpcStatus, grpcService: ( I tested all of them in different variations, but behavior is the same)

  upstreams:
  - name: grpc1
    service: grpc-svc
    port: 50051
    type: grpc
    healthCheck:
      enable: true
      interval: 20s
      port: 50051

The generated .conf looks like the following:

        health_check port=50051 interval=1s jitter=2s
            fails=1 passes=1

             type=grpc grpc_status=12
             grpc_service=helloworld.Greeter keepalive_time=60s;

The last bit, keepalive_time=60s is a HTTP check and not allowed in gRPC.

https://docs.nginx.com/nginx/admin-guide/load-balancer/grpc-health-check/#grpc-servers-that-accept-health-checking-protocol

Expected behavior Defining a gRPC health check should correctly generate a NGINX .conf with the gRPC specific checks. When using any of the gRPC specific checks, we should validate and ensure we are not adding HTTP checks.

Your environment Tested in k3d and kind: Tested NIC 3.3.0 to 3.4.2.

jasonwilliams14 avatar Jan 27 '24 22:01 jasonwilliams14

Hi @jasonwilliams14 thanks for reporting!

Be sure to check out the docs and the Contributing Guidelines while you wait for a human to take a look at this :slightly_smiling_face:

Cheers!

github-actions[bot] avatar Jan 27 '24 22:01 github-actions[bot]

We have tests that currently pass with this scenario, we need to investigate them.

danielnginx avatar Jan 29 '24 16:01 danielnginx

To provide some more context, we need to remove keepalive_time from the configured output in the above thread . keepalive_time is not a valid setting when using gRPC health checks with NGINX.

https://docs.nginx.com/nginx/admin-guide/load-balancer/grpc-health-check/#grpc-servers-that-accept-health-checking-protocol

jasonwilliams14 avatar May 08 '24 23:05 jasonwilliams14