[FEATURE] `command`, `tcpSocket` and `grpc` `livenessProbe` and `readinessProbe` support
mathieu-benoit opened this issue · comments
Detailed description
It would be ideal to support the command
, tcpSocket
and grpc
methods for livenessProbe
and readinessProbe
.
Context
Today, only the httpGet
method for livenessProbe
and readinessProbe
is supported.
command
is another very popular method, like illustrated here with grpc
apps: https://github.com/GoogleCloudPlatform/microservices-demo/blob/main/release/kubernetes-manifests.yaml#L61.
So for example, today, this below is not supported:
apiVersion: score.dev/v1b1
metadata:
name: adservice
containers:
adservice:
image: gcr.io/google-samples/microservices-demo/adservice:v0.6.0
variables:
PORT: "9555"
livenessProbe:
exec:
command:
- /bin/grpc_health_probe
- '-addr=:9555'
readinessProbe:
exec:
command:
- /bin/grpc_health_probe
- '-addr=:9555'
Possible implementation
Humanitec already supports tcpSocket
and command
in addition to httpGet
.
Note: gRPC
(only supported since Kubernetes 1.24+) is not yet supported in Humanitec. The alternative is to use the command
method by using the grpc_health_probe
binary.
Additional information
Configure Liveness, Readiness and Startup Probes in Kubernetes.
We've received a similar feature request:
"Need to translate this
"liveness_probe": { "port": "3000", "type": "tcp" },
using score"
As a workaround and if using Humanitec, you can use the Humanitec Score extension, example below:
apiVersion: humanitec.org/v1b1
profile: humanitec/default-module
spec:
containers:
adservice:
liveness_probe:
command:
- /bin/grpc_health_probe
- '-addr=:9555'
type: command
readiness_probe:
command:
- /bin/grpc_health_probe
- '-addr=:9555'
type: command