Skip to content

Commit

Permalink
[RELEASE-1.11] Backport of Support GRPC probes (#582)
Browse files Browse the repository at this point in the history
* Support gRPC probe (knative#14134)

* Add gRPC probe

* Modify unit test

* Modify unit test

* Set default to grpcprobe's service field

* Use knative pkg for ptr operation

* Use config's KubeMajor & KubeMinor instead of k8s native version pkg

* Wrap error in GRPCProbe

* Add comment to explain why use dialer_others.go

* Run update scripts

* Add probe test

* Add test in readiness/probe_test.go

* update deps

* Ignore readinessProbe when it's gRPC

* Fix test to use empemeral port

* Resolve govet lint error

* Use errors.Is to compare

* Also use ephemeral port for handler test

* drop unneccesary else block

(cherry picked from commit d02702e)

* Regenerate OCP release artifacts

---------

Co-authored-by: Seongpyo Hong <sphong0417@gmail.com>
  • Loading branch information
ReToCode and seongpyoHong authored Jan 10, 2024
1 parent 9bd87d6 commit d1ff617
Show file tree
Hide file tree
Showing 18 changed files with 576 additions and 6 deletions.
26 changes: 26 additions & 0 deletions config/core/300-resources/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,19 @@ spec:
description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.
type: integer
format: int32
grpc:
description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate.
type: object
required:
- port
properties:
port:
description: Port number of the gRPC service. Number must be in the range 1 to 65535.
type: integer
format: int32
service:
description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC."
type: string
httpGet:
description: HTTPGet specifies the http request to perform.
type: object
Expand Down Expand Up @@ -355,6 +368,19 @@ spec:
description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.
type: integer
format: int32
grpc:
description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate.
type: object
required:
- port
properties:
port:
description: Port number of the gRPC service. Number must be in the range 1 to 65535.
type: integer
format: int32
service:
description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC."
type: string
httpGet:
description: HTTPGet specifies the http request to perform.
type: object
Expand Down
26 changes: 26 additions & 0 deletions config/core/300-resources/revision.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,19 @@ spec:
description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.
type: integer
format: int32
grpc:
description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate.
type: object
required:
- port
properties:
port:
description: Port number of the gRPC service. Number must be in the range 1 to 65535.
type: integer
format: int32
service:
description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC."
type: string
httpGet:
description: HTTPGet specifies the http request to perform.
type: object
Expand Down Expand Up @@ -334,6 +347,19 @@ spec:
description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.
type: integer
format: int32
grpc:
description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate.
type: object
required:
- port
properties:
port:
description: Port number of the gRPC service. Number must be in the range 1 to 65535.
type: integer
format: int32
service:
description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC."
type: string
httpGet:
description: HTTPGet specifies the http request to perform.
type: object
Expand Down
26 changes: 26 additions & 0 deletions config/core/300-resources/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,19 @@ spec:
description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.
type: integer
format: int32
grpc:
description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate.
type: object
required:
- port
properties:
port:
description: Port number of the gRPC service. Number must be in the range 1 to 65535.
type: integer
format: int32
service:
description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC."
type: string
httpGet:
description: HTTPGet specifies the http request to perform.
type: object
Expand Down Expand Up @@ -359,6 +372,19 @@ spec:
description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.
type: integer
format: int32
grpc:
description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate.
type: object
required:
- port
properties:
port:
description: Port number of the gRPC service. Number must be in the range 1 to 65535.
type: integer
format: int32
service:
description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC."
type: string
httpGet:
description: HTTPGet specifies the http request to perform.
type: object
Expand Down
5 changes: 5 additions & 0 deletions hack/schemapatch-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ k8s.io/api/core/v1.ProbeHandler:
- Exec
- HTTPGet
- TCPSocket
- GRPC
k8s.io/api/core/v1.GRPCAction:
fieldMask:
- Port
- Service
k8s.io/api/core/v1.ExecAction:
fieldMask:
- Command
Expand Down
78 changes: 78 additions & 0 deletions openshift/release/artifacts/serving-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,19 @@ spec:
description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.
type: integer
format: int32
grpc:
description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate.
type: object
required:
- port
properties:
port:
description: Port number of the gRPC service. Number must be in the range 1 to 65535.
type: integer
format: int32
service:
description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC."
type: string
httpGet:
description: HTTPGet specifies the http request to perform.
type: object
Expand Down Expand Up @@ -1014,6 +1027,19 @@ spec:
description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.
type: integer
format: int32
grpc:
description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate.
type: object
required:
- port
properties:
port:
description: Port number of the gRPC service. Number must be in the range 1 to 65535.
type: integer
format: int32
service:
description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC."
type: string
httpGet:
description: HTTPGet specifies the http request to perform.
type: object
Expand Down Expand Up @@ -2670,6 +2696,19 @@ spec:
description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.
type: integer
format: int32
grpc:
description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate.
type: object
required:
- port
properties:
port:
description: Port number of the gRPC service. Number must be in the range 1 to 65535.
type: integer
format: int32
service:
description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC."
type: string
httpGet:
description: HTTPGet specifies the http request to perform.
type: object
Expand Down Expand Up @@ -2778,6 +2817,19 @@ spec:
description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.
type: integer
format: int32
grpc:
description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate.
type: object
required:
- port
properties:
port:
description: Port number of the gRPC service. Number must be in the range 1 to 65535.
type: integer
format: int32
service:
description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC."
type: string
httpGet:
description: HTTPGet specifies the http request to perform.
type: object
Expand Down Expand Up @@ -3951,6 +4003,19 @@ spec:
description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.
type: integer
format: int32
grpc:
description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate.
type: object
required:
- port
properties:
port:
description: Port number of the gRPC service. Number must be in the range 1 to 65535.
type: integer
format: int32
service:
description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC."
type: string
httpGet:
description: HTTPGet specifies the http request to perform.
type: object
Expand Down Expand Up @@ -4059,6 +4124,19 @@ spec:
description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.
type: integer
format: int32
grpc:
description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate.
type: object
required:
- port
properties:
port:
description: Port number of the gRPC service. Number must be in the range 1 to 65535.
type: integer
format: int32
service:
description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC."
type: string
httpGet:
description: HTTPGet specifies the http request to perform.
type: object
Expand Down
Loading

0 comments on commit d1ff617

Please sign in to comment.