Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
heka1024 committed May 28, 2024
1 parent bea3bb2 commit 1a3a30b
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ expose service their status through the [gRPC Health Checking Protocol][hc].
[Kubernetes][k8s], using the [exec probes][execprobe].

> :warning: [**Kubernetes v1.23 has now introduced built-in gRPC health checking**][k8s-new]
> capability as an alpha feature. As a result, you might no longer need to use this tool and use the
> capability as an alpha feature. And it is marked as GA now. As a result, you might no longer need to use this tool and use the
> native Kubernetes feature instead.
>
> This tool can still be useful if you are on older versions of Kubernetes,
Expand Down Expand Up @@ -68,9 +68,29 @@ implementation details. This eliminates the need for you to implement the

## Example: gRPC health checking on Kubernetes

Kubernetes does not natively support gRPC health checking since it does not
favor one RPC framework over another. Similarly, HTTP health probes Kubernetes
has is not sufficient to craft a valid gRPC request. As a solution,
Kubernetes now supports [gRPC health checking][k8s]. If your cluster is running a version of Kubernetes that supports gRPC health checking, you can use the following example to define a liveness probe for your gRPC server:

```yaml
apiVersion: v1
kind: Pod
metadata:
name: etcd-with-grpc
spec:
containers:
- name: etcd
image: registry.k8s.io/etcd:3.5.1-0
command: [ "/usr/local/bin/etcd", "--data-dir", "/var/lib/etcd", "--listen-client-urls", "http://0.0.0.0:2379", "--advertise-client-urls", "http://127.0.0.1:2379", "--log-level", "debug"]
ports:
- containerPort: 2379
livenessProbe:
grpc:
port: 2379
initialDelaySeconds: 10
```
For more information on how to define a gRPC liveness probe in Kubernetes, see the [Kubernetes documentation][k8s-new].
However, Kubernetes if your Kubernetes version does not support gRPC health checking, you can use `grpc_health_probe` to health-check your gRPC server. As a solution,
`grpc_health_probe` [can be used for Kubernetes][k8s] to health-check gRPC
servers running in the Pod.

Expand Down

0 comments on commit 1a3a30b

Please sign in to comment.