Skip to content

grpc health-checks: "check is not a valid HTTP or TCP check" #117

@VictorBac

Description

@VictorBac

Hi team!

I am using consul-esm to run health-checks for externals services running in kubernetes. It's working great for http services.

But I can't make it works with GRPC checks:

Service + health-check registration:

{
    "node": "external-node",
    "address": "127.0.0.1",
    "NodeMeta": {
        "external-source": "kubernetes",
        "external-node": "true",
        "external-probe": "true"
    },
    "service": {
        "ID": "test-grpc",
        "service": "test-grpc",
        "tags": [
            "kubernetes",
            "health-check"
        ],
        "address": "random-url",
        "port": 80,
        "meta": {
            "external-k8s-ns": "ns_name",
            "external-source": "kubernetes"
        }
    },
    "Checks": [
        {
            "Name": "test-grpc",
            "ServiceID": "test-grpc",
            "status": "failing",
            "Definition": {
                "grpc": "my-host:31314",
                "interval": "10s"
            }
        }
    ]
}

The service + health check is created:

$ curl http://consul:8500/v1/health/node/external-node?pretty
[
    {
        "Node": "external-node",
        "CheckID": "test-grpc",
        "Name": "test-grpc",
        "Status": "success",
        "Notes": "",
        "Output": "",
        "ServiceID": "test-grpc",
        "ServiceName": "test-grpc",
        "ServiceTags": [
            "kubernetes",
            "health-check"
        ],
        "Type": "grpc",
        "Definition": {
            "Interval": "10s",
            "GRPC": "my-host:31314"
        },
        "CreateIndex": 677654376,
        "ModifyIndex": 677654376
    }
]

But consul-esm doesn't even try to run the health check:

Jan 10 14:18:43 hostX consul-esm.service[8460]: 2022-01-10T14:18:43.064-0500 [WARN]  project/check.go:244: consul-esm: check is not a valid HTTP or TCP check: checkHash=external-node/test-grpc/test-grpc

I know the service is running, I can test it using https://github.com/grpc-ecosystem/grpc-health-probe:

$ grpc-health-probe -addr my-host:31314
status: SERVING

Any idea how to fix this the health-check ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions