Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for gRPC healthchecks #3825

Merged
merged 3 commits into from
Aug 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 150 additions & 0 deletions products/compute/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4188,6 +4188,7 @@ objects:
- http2_health_check
- tcp_health_check
- ssl_health_check
- grpc_health_check
properties:
- !ruby/object:Api::Type::String
name: 'host'
Expand Down Expand Up @@ -4311,6 +4312,7 @@ objects:
- http2_health_check
- tcp_health_check
- ssl_health_check
- grpc_health_check
properties:
- !ruby/object:Api::Type::String
name: 'host'
Expand Down Expand Up @@ -4434,6 +4436,7 @@ objects:
- http2_health_check
- tcp_health_check
- ssl_health_check
- grpc_health_check
properties:
- !ruby/object:Api::Type::String
name: 'request'
Expand Down Expand Up @@ -4538,6 +4541,7 @@ objects:
- http2_health_check
- tcp_health_check
- ssl_health_check
- grpc_health_check
properties:
- !ruby/object:Api::Type::String
name: 'request'
Expand Down Expand Up @@ -4642,6 +4646,7 @@ objects:
- http2_health_check
- tcp_health_check
- ssl_health_check
- grpc_health_check
properties:
- !ruby/object:Api::Type::String
name: 'host'
Expand Down Expand Up @@ -4757,6 +4762,76 @@ objects:
- :USE_FIXED_PORT
- :USE_NAMED_PORT
- :USE_SERVING_PORT
- !ruby/object:Api::Type::NestedObject
name: 'grpcHealthCheck'
exactly_one_of:
- http_health_check
- https_health_check
- http2_health_check
- tcp_health_check
- ssl_health_check
- grpc_health_check
properties:
- !ruby/object:Api::Type::Integer
name: 'port'
at_least_one_of:
- grpc_health_check.0.port
- grpc_health_check.0.port_name
- grpc_health_check.0.port_specification
- grpc_health_check.0.grpc_service_name
description: |
The port number for the health check request.
Must be specified if portName and portSpecification are not set
or if port_specification is USE_FIXED_PORT. Valid values are 1 through 65535.
- !ruby/object:Api::Type::String
name: 'portName'
at_least_one_of:
- grpc_health_check.0.port
- grpc_health_check.0.port_name
- grpc_health_check.0.port_specification
- grpc_health_check.0.grpc_service_name
description: |
Port name as defined in InstanceGroup#NamedPort#name. If both port and
port_name are defined, port takes precedence.
- !ruby/object:Api::Type::Enum
name: 'portSpecification'
at_least_one_of:
- grpc_health_check.0.port
- grpc_health_check.0.port_name
- grpc_health_check.0.port_specification
- grpc_health_check.0.grpc_service_name
description: |
Specifies how port is selected for health checking, can be one of the
following values:

* `USE_FIXED_PORT`: The port number in `port` is used for health checking.

* `USE_NAMED_PORT`: The `portName` is used for health checking.

* `USE_SERVING_PORT`: For NetworkEndpointGroup, the port specified for each
network endpoint is used for health checking. For other backends, the
port or named port specified in the Backend Service is used for health
checking.

If not specified, gRPC health check follows behavior specified in `port` and
`portName` fields.
values:
- :USE_FIXED_PORT
- :USE_NAMED_PORT
- :USE_SERVING_PORT
- !ruby/object:Api::Type::String
name: 'grpcServiceName'
at_least_one_of:
- grpc_health_check.0.port
- grpc_health_check.0.port_name
- grpc_health_check.0.port_specification
- grpc_health_check.0.grpc_service_name
description: |
The gRPC service name for the health check.
The value of grpcServiceName has the following meanings by convention:
- Empty serviceName means the overall status of all services at the backend.
- Non-empty serviceName means the health of that gRPC service, as defined by the owner of the service.
The grpcServiceName can only be ASCII.
- !ruby/object:Api::Type::NestedObject
name: 'logConfig'
description: |
Expand Down Expand Up @@ -10561,6 +10636,7 @@ objects:
- http2_health_check
- tcp_health_check
- ssl_health_check
- grpc_health_check
properties:
- !ruby/object:Api::Type::String
name: 'host'
Expand Down Expand Up @@ -10684,6 +10760,7 @@ objects:
- http2_health_check
- tcp_health_check
- ssl_health_check
- grpc_health_check
properties:
- !ruby/object:Api::Type::String
name: 'host'
Expand Down Expand Up @@ -10807,6 +10884,7 @@ objects:
- http2_health_check
- tcp_health_check
- ssl_health_check
- grpc_health_check
properties:
- !ruby/object:Api::Type::String
name: 'request'
Expand Down Expand Up @@ -10911,6 +10989,7 @@ objects:
- http2_health_check
- tcp_health_check
- ssl_health_check
- grpc_health_check
properties:
- !ruby/object:Api::Type::String
name: 'request'
Expand Down Expand Up @@ -11015,6 +11094,7 @@ objects:
- http2_health_check
- tcp_health_check
- ssl_health_check
- grpc_health_check
properties:
- !ruby/object:Api::Type::String
name: 'host'
Expand Down Expand Up @@ -11130,6 +11210,76 @@ objects:
- :USE_FIXED_PORT
- :USE_NAMED_PORT
- :USE_SERVING_PORT
- !ruby/object:Api::Type::NestedObject
name: 'grpcHealthCheck'
exactly_one_of:
- http_health_check
- https_health_check
- http2_health_check
- tcp_health_check
- ssl_health_check
- grpc_health_check
properties:
- !ruby/object:Api::Type::Integer
name: 'port'
at_least_one_of:
- grpc_health_check.0.port
- grpc_health_check.0.port_name
- grpc_health_check.0.port_specification
- grpc_health_check.0.grpc_service_name
description: |
The port number for the health check request.
Must be specified if portName and portSpecification are not set
or if port_specification is USE_FIXED_PORT. Valid values are 1 through 65535.
- !ruby/object:Api::Type::String
name: 'portName'
at_least_one_of:
- grpc_health_check.0.port
- grpc_health_check.0.port_name
- grpc_health_check.0.port_specification
- grpc_health_check.0.grpc_service_name
description: |
Port name as defined in InstanceGroup#NamedPort#name. If both port and
port_name are defined, port takes precedence.
- !ruby/object:Api::Type::Enum
name: 'portSpecification'
at_least_one_of:
- grpc_health_check.0.port
- grpc_health_check.0.port_name
- grpc_health_check.0.port_specification
- grpc_health_check.0.grpc_service_name
description: |
Specifies how port is selected for health checking, can be one of the
following values:

* `USE_FIXED_PORT`: The port number in `port` is used for health checking.

* `USE_NAMED_PORT`: The `portName` is used for health checking.

* `USE_SERVING_PORT`: For NetworkEndpointGroup, the port specified for each
network endpoint is used for health checking. For other backends, the
port or named port specified in the Backend Service is used for health
checking.

If not specified, gRPC health check follows behavior specified in `port` and
`portName` fields.
values:
- :USE_FIXED_PORT
- :USE_NAMED_PORT
- :USE_SERVING_PORT
- !ruby/object:Api::Type::String
name: 'grpcServiceName'
at_least_one_of:
- grpc_health_check.0.port
- grpc_health_check.0.port_name
- grpc_health_check.0.port_specification
- grpc_health_check.0.grpc_service_name
description: |
The gRPC service name for the health check.
The value of grpcServiceName has the following meanings by convention:
- Empty serviceName means the overall status of all services at the backend.
- Non-empty serviceName means the health of that gRPC service, as defined by the owner of the service.
The grpcServiceName can only be ASCII.
- !ruby/object:Api::Type::NestedObject
name: 'logConfig'
description: |
Expand Down
24 changes: 24 additions & 0 deletions products/compute/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,16 @@ overrides: !ruby/object:Overrides::ResourceOverrides
primary_resource_id: "http2-health-check"
vars:
health_check_name: "http2-health-check"
- !ruby/object:Provider::Terraform::Examples
name: "health_check_grpc"
primary_resource_id: "grpc-health-check"
vars:
health_check_name: "grpc-health-check"
- !ruby/object:Provider::Terraform::Examples
name: "health_check_grpc_full"
primary_resource_id: "grpc-health-check"
vars:
health_check_name: "grpc-health-check"
- !ruby/object:Provider::Terraform::Examples
name: "health_check_with_logging"
primary_resource_id: "health-check-with-logging"
Expand All @@ -908,6 +918,8 @@ overrides: !ruby/object:Overrides::ResourceOverrides
diff_suppress_func: 'portDiffSuppress'
sslHealthCheck: !ruby/object:Overrides::Terraform::PropertyOverride
diff_suppress_func: 'portDiffSuppress'
grpcHealthCheck: !ruby/object:Overrides::Terraform::PropertyOverride
diff_suppress_func: 'portDiffSuppress'
Image: !ruby/object:Overrides::Terraform::ResourceOverride
examples:
- !ruby/object:Provider::Terraform::Examples
Expand Down Expand Up @@ -1603,6 +1615,16 @@ overrides: !ruby/object:Overrides::ResourceOverrides
primary_resource_id: "http2-region-health-check"
vars:
health_check_name: "http2-region-health-check"
- !ruby/object:Provider::Terraform::Examples
name: "region_health_check_grpc"
primary_resource_id: "grpc-region-health-check"
vars:
health_check_name: "grpc-region-health-check"
- !ruby/object:Provider::Terraform::Examples
name: "region_health_check_grpc_full"
primary_resource_id: "grpc-region-health-check"
vars:
health_check_name: "grpc-region-health-check"
custom_code: !ruby/object:Provider::Terraform::CustomCode
encoder: templates/terraform/encoders/health_check_type.erb
resource_definition: templates/terraform/resource_definition/health_check.erb
Expand All @@ -1629,6 +1651,8 @@ overrides: !ruby/object:Overrides::ResourceOverrides
diff_suppress_func: 'portDiffSuppress'
sslHealthCheck: !ruby/object:Overrides::Terraform::PropertyOverride
diff_suppress_func: 'portDiffSuppress'
grpcHealthCheck: !ruby/object:Overrides::Terraform::PropertyOverride
diff_suppress_func: 'portDiffSuppress'
RegionUrlMap: !ruby/object:Overrides::Terraform::ResourceOverride
examples:
- !ruby/object:Provider::Terraform::Examples
Expand Down
10 changes: 10 additions & 0 deletions templates/terraform/examples/health_check_grpc.tf.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
resource "google_compute_health_check" "grpc-health-check" {
name = "<%= ctx[:vars]['health_check_name'] %>"

timeout_sec = 1
check_interval_sec = 1

grpc_health_check {
port = "443"
}
}
12 changes: 12 additions & 0 deletions templates/terraform/examples/health_check_grpc_full.tf.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
resource "google_compute_health_check" "grpc-health-check" {
name = "<%= ctx[:vars]['health_check_name'] %>"

timeout_sec = 1
check_interval_sec = 1

grpc_health_check {
port_name = "health-check-port"
port_specification = "USE_NAMED_PORT"
grpc_service_name = "testservice"
}
}
10 changes: 10 additions & 0 deletions templates/terraform/examples/region_health_check_grpc.tf.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
resource "google_compute_region_health_check" "grpc-health-check" {
name = "<%= ctx[:vars]['health_check_name'] %>"

timeout_sec = 1
check_interval_sec = 1

grpc_health_check {
port = "443"
}
}
12 changes: 12 additions & 0 deletions templates/terraform/examples/region_health_check_grpc_full.tf.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
resource "google_compute_region_health_check" "grpc-health-check" {
name = "<%= ctx[:vars]['health_check_name'] %>"

timeout_sec = 1
check_interval_sec = 1

grpc_health_check {
port_name = "health-check-port"
port_specification = "USE_NAMED_PORT"
grpc_service_name = "testservice"
}
}