score-spec / spec

The Score Specification provides a developer-centric and platform-agnostic Workload specification to improve developer productivity and experience. It eliminates configuration inconsistencies between environments.

Home Page:https://score.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[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.

Thank you for your issue. Give us a little time to review it.

PS. You might want to check the FAQ if you haven't done so already.

This is an automated reply, generated by FAQtory

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