diff --git a/docs/BUILD b/docs/BUILD index f9a1c04d..149f2410 100644 --- a/docs/BUILD +++ b/docs/BUILD @@ -43,6 +43,7 @@ proto_library( "//envoy/config/filter/network/rate_limit/v2:rate_limit", "//envoy/config/filter/network/redis_proxy/v2:redis_proxy", "//envoy/config/filter/network/tcp_proxy/v2:tcp_proxy", + "//envoy/config/health_checker/redis/v2:redis", "//envoy/config/metrics/v2:metrics_service", "//envoy/config/metrics/v2:stats", "//envoy/config/ratelimit/v2:rls", diff --git a/envoy/api/v2/core/health_check.proto b/envoy/api/v2/core/health_check.proto index 41303f88..88ceb09f 100644 --- a/envoy/api/v2/core/health_check.proto +++ b/envoy/api/v2/core/health_check.proto @@ -5,6 +5,7 @@ package envoy.api.v2.core; import "envoy/api/v2/core/base.proto"; import "google/protobuf/duration.proto"; +import "google/protobuf/struct.proto"; import "google/protobuf/wrappers.proto"; import "validate/validate.proto"; @@ -115,6 +116,16 @@ message HealthCheck { string service_name = 1; } + // [#not-implemented-hide:] Custom health check. + message CustomHealthCheck { + // The registered name of the custom health check. + string name = 1 [(validate.rules).string.min_bytes = 1]; + + // A custom health checker specific configuration which depends on the custom health checker + // being instantiated. See :api:`envoy/config/health_checker` for reference. + google.protobuf.Struct config = 2; + } + oneof health_checker { option (validate.required) = true; @@ -129,6 +140,9 @@ message HealthCheck { // gRPC health check. GrpcHealthCheck grpc_health_check = 11; + + // [#not-implemented-hide:] Custom health check. + CustomHealthCheck custom_health_check = 13; } // The "no traffic interval" is a special health check interval that is used when a cluster has diff --git a/envoy/config/health_checker/redis/v2/BUILD b/envoy/config/health_checker/redis/v2/BUILD new file mode 100644 index 00000000..7d217c54 --- /dev/null +++ b/envoy/config/health_checker/redis/v2/BUILD @@ -0,0 +1,8 @@ +load("//bazel:api_build_system.bzl", "api_proto_library") + +licenses(["notice"]) # Apache 2 + +api_proto_library( + name = "redis", + srcs = ["redis.proto"], +) diff --git a/envoy/config/health_checker/redis/v2/redis.proto b/envoy/config/health_checker/redis/v2/redis.proto new file mode 100644 index 00000000..7c82c9ac --- /dev/null +++ b/envoy/config/health_checker/redis/v2/redis.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +package envoy.config.health_checker.redis.v2; +option go_package = "v2"; + +// [#not-implemented-hide:] +// [#protodoc-title: Redis] +// Redis :ref:`configuration overview `. +// Configuration for the Redis custom health checker. +message Redis { + // If set, optionally perform ``EXISTS `` instead of ``PING``. A return value + // from Redis of 0 (does not exist) is considered a passing healthcheck. A return value other + // than 0 is considered a failure. This allows the user to mark a Redis instance for maintenance + // by setting the specified key to any value and waiting for traffic to drain. + string key = 1; +} diff --git a/test/validate/BUILD b/test/validate/BUILD index 5ccc9f1b..467a3e74 100644 --- a/test/validate/BUILD +++ b/test/validate/BUILD @@ -28,5 +28,6 @@ api_cc_test( "//envoy/config/filter/network/mongo_proxy/v2:mongo_proxy", "//envoy/config/filter/network/redis_proxy/v2:redis_proxy", "//envoy/config/filter/network/tcp_proxy/v2:tcp_proxy", + "//envoy/config/health_checker/redis/v2:redis", ], ) diff --git a/test/validate/pgv_test.cc b/test/validate/pgv_test.cc index 31d64fe7..f30f1cc6 100644 --- a/test/validate/pgv_test.cc +++ b/test/validate/pgv_test.cc @@ -8,6 +8,7 @@ #include "envoy/api/v2/lds.pb.validate.h" #include "envoy/api/v2/rds.pb.validate.h" #include "envoy/api/v2/core/protocol.pb.validate.h" +#include "envoy/config/health_checker/redis/v2/redis.pb.validate.h" #include "envoy/config/filter/accesslog/v2/accesslog.pb.validate.h" #include "envoy/config/filter/http/buffer/v2/buffer.pb.validate.h" #include "envoy/config/filter/http/fault/v2/fault.pb.validate.h"