https://github.com/jijiechen/grpc-probe-app
An example app demonstrating gRPC health check to support Kubernetes readiness/liveness/startup probes.
https://github.com/jijiechen/grpc-probe-app
grpc kubernetes
Last synced: 12 months ago
JSON representation
An example app demonstrating gRPC health check to support Kubernetes readiness/liveness/startup probes.
- Host: GitHub
- URL: https://github.com/jijiechen/grpc-probe-app
- Owner: jijiechen
- License: mit
- Created: 2024-04-16T02:26:26.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-16T03:37:04.000Z (almost 2 years ago)
- Last Synced: 2025-02-14T07:47:44.797Z (about 1 year ago)
- Topics: grpc, kubernetes
- Language: Go
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
An example application demonstrating how to use gRPC health checking.
# Usage
You may use this app directly using docker:
```
docker run --rm -it jijiechen/grpc-probe-app:latest
```
Or if you'd like to build yourself, please clone the code and execute the following commands:
```sh
go build -o grpc-probe-app .
./grpc-probe-app [--port 5085]
```
## Test the greeter server
Execute these commands:
```sh
# install grpcurl
# go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest
grpcurl -proto ./proto/helloworld.proto -d '{"name": "Avatar"}' -plaintext localhost:5085 helloworld.Greeter/SayHello
```
## Test the health check probe server
Execute these commands:
```sh
# install grpcurl
# go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest
grpcurl -proto ./proto/healthcheck.proto -d '{"service": "readiness"}' -plaintext localhost:5085 grpc.health.v1.Health/Check
grpcurl -proto ./proto/healthcheck.proto -d '{"service": "liveness"}' -plaintext localhost:5085 grpc.health.v1.Health/Watch
```
# Protocol
1. This application implements the [hello world greeter protocol](https://github.com/grpc/grpc-go/blob/master/examples/helloworld/helloworld/helloworld.proto).
2. This application implements the gRPC health checking protocol. The protocol is defined in the following document:
https://github.com/grpc/grpc/blob/master/doc/health-checking.md
It can be used as a Kubernetes gRPC readiness/liveness/startup probe handler.
# TroubleShooting
Q: Readiness probe errored: missing probe handler for pod(uid):container
A: Please make sure your Kubernetes cluster support the gRPC container probe feature. The feature is available in Kubernetes 1.23+, and requires the `GRPCContainerProbe` feature gate to be turned on a Kubernetes cluster older than 1.27.