diff --git a/api/mesh/v1alpha1/health_check.pb.go b/api/mesh/v1alpha1/health_check.pb.go index 9b01c1740a51..9d47f28b1f10 100644 --- a/api/mesh/v1alpha1/health_check.pb.go +++ b/api/mesh/v1alpha1/health_check.pb.go @@ -123,13 +123,30 @@ type HealthCheck_Conf struct { // interval_jitter_percent are both set, both of them will be used to // increase the wait time. IntervalJitterPercent uint32 `protobuf:"varint,9,opt,name=interval_jitter_percent,json=intervalJitterPercent,proto3" json:"interval_jitter_percent,omitempty"` - // Allows to configure panic threshold for Envoy cluster. If not specified, the default is 50%. - // To disable panic mode, set to 0%. + // Allows to configure panic threshold for Envoy cluster. If not specified, + // the default is 50%. To disable panic mode, set to 0%. HealthyPanicThreshold *wrappers.FloatValue `protobuf:"bytes,10,opt,name=healthy_panic_threshold,json=healthyPanicThreshold,proto3" json:"healthy_panic_threshold,omitempty"` - // If set to true, Envoy will not consider any hosts when the cluster is in 'panic - // mode'. Instead, the cluster will fail all requests as if all hosts are unhealthy. - // This can help avoid potentially overwhelming a failing service. + // If set to true, Envoy will not consider any hosts when the cluster is in + // 'panic mode'. Instead, the cluster will fail all requests as if all hosts + // are unhealthy. This can help avoid potentially overwhelming a failing + // service. FailTrafficOnPanic *wrappers.BoolValue `protobuf:"bytes,11,opt,name=fail_traffic_on_panic,json=failTrafficOnPanic,proto3" json:"fail_traffic_on_panic,omitempty"` + // Specifies the path to the file where Envoy can log health check events. + // If empty, no event log will be written. + EventLogPath string `protobuf:"bytes,12,opt,name=event_log_path,json=eventLogPath,proto3" json:"event_log_path,omitempty"` + // If set to true, health check failure events will always be logged. If set + // to false, only the initial health check failure event will be logged. The + // default value is false. + AlwaysLogHealthCheckFailures *wrappers.BoolValue `protobuf:"bytes,13,opt,name=always_log_health_check_failures,json=alwaysLogHealthCheckFailures,proto3" json:"always_log_health_check_failures,omitempty"` + // The "no traffic interval" is a special health check interval that is used + // when a cluster has never had traffic routed to it. This lower interval + // allows cluster information to be kept up to date, without sending a + // potentially large amount of active health checking traffic for no reason. + // Once a cluster has been used for traffic routing, Envoy will shift back + // to using the standard health check interval that is defined. Note that + // this interval takes precedence over any other. The default value for "no + // traffic interval" is 60 seconds. + NoTrafficInterval *duration.Duration `protobuf:"bytes,14,opt,name=no_traffic_interval,json=noTrafficInterval,proto3" json:"no_traffic_interval,omitempty"` // Types that are assignable to Protocol: // *HealthCheck_Conf_Tcp_ // *HealthCheck_Conf_Http_ @@ -231,6 +248,27 @@ func (x *HealthCheck_Conf) GetFailTrafficOnPanic() *wrappers.BoolValue { return nil } +func (x *HealthCheck_Conf) GetEventLogPath() string { + if x != nil { + return x.EventLogPath + } + return "" +} + +func (x *HealthCheck_Conf) GetAlwaysLogHealthCheckFailures() *wrappers.BoolValue { + if x != nil { + return x.AlwaysLogHealthCheckFailures + } + return nil +} + +func (x *HealthCheck_Conf) GetNoTrafficInterval() *duration.Duration { + if x != nil { + return x.NoTrafficInterval + } + return nil +} + func (m *HealthCheck_Conf) GetProtocol() isHealthCheck_Conf_Protocol { if m != nil { return m.Protocol @@ -536,7 +574,7 @@ var file_mesh_v1alpha1_health_check_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe4, 0x0b, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb9, 0x0d, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x40, 0x0a, 0x07, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6b, 0x75, 0x6d, 0x61, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, @@ -550,7 +588,7 @@ var file_mesh_v1alpha1_health_check_proto_rawDesc = []byte{ 0x6f, 0x6e, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6b, 0x75, 0x6d, 0x61, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x52, - 0x04, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x8c, 0x0a, 0x0a, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0x12, 0x41, + 0x04, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0xe1, 0x0b, 0x0a, 0x04, 0x43, 0x6f, 0x6e, 0x66, 0x12, 0x41, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0a, 0xfa, 0x42, 0x07, @@ -588,53 +626,66 @@ var file_mesh_v1alpha1_health_check_proto_rawDesc = []byte{ 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x12, 0x66, 0x61, 0x69, 0x6c, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x4f, 0x6e, 0x50, - 0x61, 0x6e, 0x69, 0x63, 0x12, 0x3c, 0x0a, 0x03, 0x74, 0x63, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x28, 0x2e, 0x6b, 0x75, 0x6d, 0x61, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x2e, 0x54, 0x63, 0x70, 0x48, 0x00, 0x52, 0x03, 0x74, - 0x63, 0x70, 0x12, 0x3f, 0x0a, 0x04, 0x68, 0x74, 0x74, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x29, 0x2e, 0x6b, 0x75, 0x6d, 0x61, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x48, 0x00, 0x52, 0x04, 0x68, - 0x74, 0x74, 0x70, 0x1a, 0x6d, 0x0a, 0x03, 0x54, 0x63, 0x70, 0x12, 0x2f, 0x0a, 0x04, 0x73, 0x65, - 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x79, 0x74, 0x65, 0x73, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, 0x73, 0x65, 0x6e, 0x64, 0x12, 0x35, 0x0a, 0x07, 0x72, - 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, - 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x72, 0x65, 0x63, 0x65, 0x69, - 0x76, 0x65, 0x1a, 0xb3, 0x03, 0x0a, 0x04, 0x48, 0x74, 0x74, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x70, - 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, - 0x70, 0x0a, 0x16, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x3b, 0x2e, 0x6b, 0x75, 0x6d, 0x61, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x72, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x54, 0x6f, 0x41, 0x64, - 0x64, 0x12, 0x55, 0x0a, 0x11, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, - 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x2a, - 0x05, 0x10, 0xd8, 0x04, 0x28, 0x64, 0x52, 0x10, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x1a, 0x35, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x1a, - 0x96, 0x01, 0x0a, 0x11, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4d, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x6b, 0x75, 0x6d, 0x61, 0x2e, 0x6d, 0x65, 0x73, - 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, - 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x2e, 0x48, 0x74, 0x74, 0x70, - 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x68, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x18, 0x02, + 0x61, 0x6e, 0x69, 0x63, 0x12, 0x24, 0x0a, 0x0e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x6f, + 0x67, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x67, 0x50, 0x61, 0x74, 0x68, 0x12, 0x62, 0x0a, 0x20, 0x61, 0x6c, + 0x77, 0x61, 0x79, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x5f, + 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x52, 0x06, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x0a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x42, 0x2a, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x6b, 0x75, 0x6d, 0x61, 0x68, 0x71, 0x2f, 0x6b, 0x75, 0x6d, 0x61, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x1c, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x4c, 0x6f, 0x67, 0x48, 0x65, 0x61, 0x6c, 0x74, + 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x73, 0x12, 0x49, + 0x0a, 0x13, 0x6e, 0x6f, 0x5f, 0x74, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x5f, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x6e, 0x6f, 0x54, 0x72, 0x61, 0x66, 0x66, 0x69, + 0x63, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x3c, 0x0a, 0x03, 0x74, 0x63, 0x70, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6b, 0x75, 0x6d, 0x61, 0x2e, 0x6d, 0x65, + 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, + 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x2e, 0x54, 0x63, 0x70, + 0x48, 0x00, 0x52, 0x03, 0x74, 0x63, 0x70, 0x12, 0x3f, 0x0a, 0x04, 0x68, 0x74, 0x74, 0x70, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6b, 0x75, 0x6d, 0x61, 0x2e, 0x6d, 0x65, 0x73, + 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, + 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x2e, 0x48, 0x74, 0x74, 0x70, + 0x48, 0x00, 0x52, 0x04, 0x68, 0x74, 0x74, 0x70, 0x1a, 0x6d, 0x0a, 0x03, 0x54, 0x63, 0x70, 0x12, + 0x2f, 0x0a, 0x04, 0x73, 0x65, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x42, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, 0x73, 0x65, 0x6e, 0x64, + 0x12, 0x35, 0x0a, 0x07, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, + 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x1a, 0xb3, 0x03, 0x0a, 0x04, 0x48, 0x74, 0x74, 0x70, + 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x70, 0x61, 0x74, 0x68, 0x12, 0x70, 0x0a, 0x16, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x6b, 0x75, 0x6d, 0x61, 0x2e, 0x6d, 0x65, 0x73, 0x68, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x2e, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x13, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x73, 0x54, 0x6f, 0x41, 0x64, 0x64, 0x12, 0x55, 0x0a, 0x11, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, + 0x65, 0x64, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, + 0x0a, 0xfa, 0x42, 0x07, 0x2a, 0x05, 0x10, 0xd8, 0x04, 0x28, 0x64, 0x52, 0x10, 0x65, 0x78, 0x70, + 0x65, 0x63, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x1a, 0x35, 0x0a, + 0x0b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x96, 0x01, 0x0a, 0x11, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4d, 0x0a, 0x06, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x6b, 0x75, 0x6d, + 0x61, 0x2e, 0x6d, 0x65, 0x73, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x2e, 0x43, 0x6f, 0x6e, 0x66, + 0x2e, 0x48, 0x74, 0x74, 0x70, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x06, 0x61, 0x70, 0x70, + 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x42, 0x0a, 0x0a, + 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x42, 0x2a, 0x5a, 0x28, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x75, 0x6d, 0x61, 0x68, 0x71, 0x2f, 0x6b, + 0x75, 0x6d, 0x61, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x68, 0x2f, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -674,19 +725,21 @@ var file_mesh_v1alpha1_health_check_proto_depIdxs = []int32{ 7, // 6: kuma.mesh.v1alpha1.HealthCheck.Conf.interval_jitter:type_name -> google.protobuf.Duration 8, // 7: kuma.mesh.v1alpha1.HealthCheck.Conf.healthy_panic_threshold:type_name -> google.protobuf.FloatValue 9, // 8: kuma.mesh.v1alpha1.HealthCheck.Conf.fail_traffic_on_panic:type_name -> google.protobuf.BoolValue - 2, // 9: kuma.mesh.v1alpha1.HealthCheck.Conf.tcp:type_name -> kuma.mesh.v1alpha1.HealthCheck.Conf.Tcp - 3, // 10: kuma.mesh.v1alpha1.HealthCheck.Conf.http:type_name -> kuma.mesh.v1alpha1.HealthCheck.Conf.Http - 10, // 11: kuma.mesh.v1alpha1.HealthCheck.Conf.Tcp.send:type_name -> google.protobuf.BytesValue - 10, // 12: kuma.mesh.v1alpha1.HealthCheck.Conf.Tcp.receive:type_name -> google.protobuf.BytesValue - 5, // 13: kuma.mesh.v1alpha1.HealthCheck.Conf.Http.request_headers_to_add:type_name -> kuma.mesh.v1alpha1.HealthCheck.Conf.Http.HeaderValueOption - 11, // 14: kuma.mesh.v1alpha1.HealthCheck.Conf.Http.expected_statuses:type_name -> google.protobuf.UInt32Value - 4, // 15: kuma.mesh.v1alpha1.HealthCheck.Conf.Http.HeaderValueOption.header:type_name -> kuma.mesh.v1alpha1.HealthCheck.Conf.Http.HeaderValue - 9, // 16: kuma.mesh.v1alpha1.HealthCheck.Conf.Http.HeaderValueOption.append:type_name -> google.protobuf.BoolValue - 17, // [17:17] is the sub-list for method output_type - 17, // [17:17] is the sub-list for method input_type - 17, // [17:17] is the sub-list for extension type_name - 17, // [17:17] is the sub-list for extension extendee - 0, // [0:17] is the sub-list for field type_name + 9, // 9: kuma.mesh.v1alpha1.HealthCheck.Conf.always_log_health_check_failures:type_name -> google.protobuf.BoolValue + 7, // 10: kuma.mesh.v1alpha1.HealthCheck.Conf.no_traffic_interval:type_name -> google.protobuf.Duration + 2, // 11: kuma.mesh.v1alpha1.HealthCheck.Conf.tcp:type_name -> kuma.mesh.v1alpha1.HealthCheck.Conf.Tcp + 3, // 12: kuma.mesh.v1alpha1.HealthCheck.Conf.http:type_name -> kuma.mesh.v1alpha1.HealthCheck.Conf.Http + 10, // 13: kuma.mesh.v1alpha1.HealthCheck.Conf.Tcp.send:type_name -> google.protobuf.BytesValue + 10, // 14: kuma.mesh.v1alpha1.HealthCheck.Conf.Tcp.receive:type_name -> google.protobuf.BytesValue + 5, // 15: kuma.mesh.v1alpha1.HealthCheck.Conf.Http.request_headers_to_add:type_name -> kuma.mesh.v1alpha1.HealthCheck.Conf.Http.HeaderValueOption + 11, // 16: kuma.mesh.v1alpha1.HealthCheck.Conf.Http.expected_statuses:type_name -> google.protobuf.UInt32Value + 4, // 17: kuma.mesh.v1alpha1.HealthCheck.Conf.Http.HeaderValueOption.header:type_name -> kuma.mesh.v1alpha1.HealthCheck.Conf.Http.HeaderValue + 9, // 18: kuma.mesh.v1alpha1.HealthCheck.Conf.Http.HeaderValueOption.append:type_name -> google.protobuf.BoolValue + 19, // [19:19] is the sub-list for method output_type + 19, // [19:19] is the sub-list for method input_type + 19, // [19:19] is the sub-list for extension type_name + 19, // [19:19] is the sub-list for extension extendee + 0, // [0:19] is the sub-list for field type_name } func init() { file_mesh_v1alpha1_health_check_proto_init() } diff --git a/api/mesh/v1alpha1/health_check.proto b/api/mesh/v1alpha1/health_check.proto index 775648c072f3..c87481bd0b25 100644 --- a/api/mesh/v1alpha1/health_check.proto +++ b/api/mesh/v1alpha1/health_check.proto @@ -66,6 +66,25 @@ message HealthCheck { // service. google.protobuf.BoolValue fail_traffic_on_panic = 11; + // Specifies the path to the file where Envoy can log health check events. + // If empty, no event log will be written. + string event_log_path = 12; + + // If set to true, health check failure events will always be logged. If set + // to false, only the initial health check failure event will be logged. The + // default value is false. + google.protobuf.BoolValue always_log_health_check_failures = 13; + + // The "no traffic interval" is a special health check interval that is used + // when a cluster has never had traffic routed to it. This lower interval + // allows cluster information to be kept up to date, without sending a + // potentially large amount of active health checking traffic for no reason. + // Once a cluster has been used for traffic routing, Envoy will shift back + // to using the standard health check interval that is defined. Note that + // this interval takes precedence over any other. The default value for "no + // traffic interval" is 60 seconds. + google.protobuf.Duration no_traffic_interval = 14; + // Tcp defines optional configuration for specifying bytes to send and // expected response during the health check message Tcp { diff --git a/pkg/core/resources/apis/mesh/healthcheck_validator.go b/pkg/core/resources/apis/mesh/healthcheck_validator.go index 7cb27e7ea6ce..b8ad2b9b6991 100644 --- a/pkg/core/resources/apis/mesh/healthcheck_validator.go +++ b/pkg/core/resources/apis/mesh/healthcheck_validator.go @@ -105,6 +105,9 @@ func (d *HealthCheckResource) validateConf() (err validators.ValidationError) { if d.Spec.Conf.IntervalJitter != nil { err.Add(ValidateDuration(path.Field("intervalJitter"), d.Spec.Conf.IntervalJitter)) } + if d.Spec.Conf.NoTrafficInterval != nil { + err.Add(ValidateDuration(path.Field("noTrafficInterval"), d.Spec.Conf.NoTrafficInterval)) + } err.Add(d.validatePercentage(path.Field("healthyPanicThreshold"), d.Spec.Conf.HealthyPanicThreshold)) if d.Spec.Conf.GetHttp() != nil { err.Add(d.validateConfHttp(path.Field("http"))) diff --git a/pkg/core/resources/apis/mesh/healthcheck_validator_test.go b/pkg/core/resources/apis/mesh/healthcheck_validator_test.go index 7d88f0e0f00d..57e3d6c6ac4c 100644 --- a/pkg/core/resources/apis/mesh/healthcheck_validator_test.go +++ b/pkg/core/resources/apis/mesh/healthcheck_validator_test.go @@ -114,6 +114,7 @@ var _ = Describe("HealthCheck", func() { initialJitter: 0s intervalJitter: 0s healthyPanicThreshold: 101 + noTrafficInterval: 0s http: path: "" requestHeadersToAdd: @@ -138,6 +139,8 @@ var _ = Describe("HealthCheck", func() { message: must have a positive value - field: conf.intervalJitter message: must have a positive value + - field: conf.noTrafficInterval + message: must have a positive value - field: conf.healthyPanicThreshold message: must be in range [0.0 - 100.0] - field: conf.http.path diff --git a/pkg/xds/envoy/clusters/v2/health_check_configurer.go b/pkg/xds/envoy/clusters/v2/health_check_configurer.go index a8586659e185..d87714f8e94f 100644 --- a/pkg/xds/envoy/clusters/v2/health_check_configurer.go +++ b/pkg/xds/envoy/clusters/v2/health_check_configurer.go @@ -139,13 +139,16 @@ func (e *HealthCheckConfigurer) Configure(cluster *envoy_api.Cluster) error { HealthChecker: &envoy_core.HealthCheck_TcpHealthCheck_{ TcpHealthCheck: &envoy_core.HealthCheck_TcpHealthCheck{}, }, - Interval: activeChecks.Interval, - Timeout: activeChecks.Timeout, - UnhealthyThreshold: &wrappers.UInt32Value{Value: activeChecks.UnhealthyThreshold}, - HealthyThreshold: &wrappers.UInt32Value{Value: activeChecks.HealthyThreshold}, - InitialJitter: activeChecks.InitialJitter, - IntervalJitter: activeChecks.IntervalJitter, - IntervalJitterPercent: activeChecks.IntervalJitterPercent, + Interval: activeChecks.Interval, + Timeout: activeChecks.Timeout, + UnhealthyThreshold: &wrappers.UInt32Value{Value: activeChecks.UnhealthyThreshold}, + HealthyThreshold: &wrappers.UInt32Value{Value: activeChecks.HealthyThreshold}, + InitialJitter: activeChecks.InitialJitter, + IntervalJitter: activeChecks.IntervalJitter, + IntervalJitterPercent: activeChecks.IntervalJitterPercent, + EventLogPath: activeChecks.EventLogPath, + AlwaysLogHealthCheckFailures: activeChecks.AlwaysLogHealthCheckFailures.GetValue(), + NoTrafficInterval: activeChecks.NoTrafficInterval, } healthPanicThreshold(cluster, activeChecks.GetHealthyPanicThreshold()) diff --git a/pkg/xds/envoy/clusters/v2/health_check_configurer_test.go b/pkg/xds/envoy/clusters/v2/health_check_configurer_test.go index cbff971a2f34..955a70cc9c50 100644 --- a/pkg/xds/envoy/clusters/v2/health_check_configurer_test.go +++ b/pkg/xds/envoy/clusters/v2/health_check_configurer_test.go @@ -348,6 +348,44 @@ var _ = Describe("HealthCheckConfigurer", func() { timeout: 4s unhealthyThreshold: 3 name: testCluster + type: EDS`, + }), + Entry("HealthCheck with event log path", testCase{ + clusterName: "testCluster", + healthCheck: &mesh_core.HealthCheckResource{ + Spec: &mesh_proto.HealthCheck{ + Sources: []*mesh_proto.Selector{ + {Match: mesh_proto.TagSelector{"kuma.io/service": "backend"}}, + }, + Destinations: []*mesh_proto.Selector{ + {Match: mesh_proto.TagSelector{"kuma.io/service": "redis"}}, + }, + Conf: &mesh_proto.HealthCheck_Conf{ + Interval: ptypes.DurationProto(5 * time.Second), + Timeout: ptypes.DurationProto(4 * time.Second), + NoTrafficInterval: ptypes.DurationProto(6 * time.Second), + UnhealthyThreshold: 3, + HealthyThreshold: 2, + EventLogPath: "/event/log/path", + AlwaysLogHealthCheckFailures: &wrappers.BoolValue{Value: true}, + }, + }, + }, + expected: ` + connectTimeout: 5s + edsClusterConfig: + edsConfig: + ads: {} + healthChecks: + - alwaysLogHealthCheckFailures: true + eventLogPath: /event/log/path + healthyThreshold: 2 + interval: 5s + noTrafficInterval: 6s + tcpHealthCheck: {} + timeout: 4s + unhealthyThreshold: 3 + name: testCluster type: EDS`, }), ) diff --git a/pkg/xds/envoy/clusters/v3/health_check_configurer.go b/pkg/xds/envoy/clusters/v3/health_check_configurer.go index 6ee2b51b6a19..8c0e05c23086 100644 --- a/pkg/xds/envoy/clusters/v3/health_check_configurer.go +++ b/pkg/xds/envoy/clusters/v3/health_check_configurer.go @@ -141,13 +141,16 @@ func (e *HealthCheckConfigurer) Configure(cluster *envoy_cluster.Cluster) error HealthChecker: &envoy_core.HealthCheck_TcpHealthCheck_{ TcpHealthCheck: &envoy_core.HealthCheck_TcpHealthCheck{}, }, - Interval: activeChecks.Interval, - Timeout: activeChecks.Timeout, - UnhealthyThreshold: &wrappers.UInt32Value{Value: activeChecks.UnhealthyThreshold}, - HealthyThreshold: &wrappers.UInt32Value{Value: activeChecks.HealthyThreshold}, - InitialJitter: activeChecks.InitialJitter, - IntervalJitter: activeChecks.IntervalJitter, - IntervalJitterPercent: activeChecks.IntervalJitterPercent, + Interval: activeChecks.Interval, + Timeout: activeChecks.Timeout, + UnhealthyThreshold: &wrappers.UInt32Value{Value: activeChecks.UnhealthyThreshold}, + HealthyThreshold: &wrappers.UInt32Value{Value: activeChecks.HealthyThreshold}, + InitialJitter: activeChecks.InitialJitter, + IntervalJitter: activeChecks.IntervalJitter, + IntervalJitterPercent: activeChecks.IntervalJitterPercent, + EventLogPath: activeChecks.EventLogPath, + AlwaysLogHealthCheckFailures: activeChecks.AlwaysLogHealthCheckFailures.GetValue(), + NoTrafficInterval: activeChecks.NoTrafficInterval, } healthPanicThreshold(cluster, activeChecks.GetHealthyPanicThreshold()) diff --git a/pkg/xds/envoy/clusters/v3/health_check_configurer_test.go b/pkg/xds/envoy/clusters/v3/health_check_configurer_test.go index 24916a5c3571..e364d11954d0 100644 --- a/pkg/xds/envoy/clusters/v3/health_check_configurer_test.go +++ b/pkg/xds/envoy/clusters/v3/health_check_configurer_test.go @@ -356,6 +356,45 @@ var _ = Describe("HealthCheckConfigurer", func() { timeout: 4s unhealthyThreshold: 3 name: testCluster + type: EDS`, + }), + Entry("HealthCheck with event log path", testCase{ + clusterName: "testCluster", + healthCheck: &mesh_core.HealthCheckResource{ + Spec: &mesh_proto.HealthCheck{ + Sources: []*mesh_proto.Selector{ + {Match: mesh_proto.TagSelector{"kuma.io/service": "backend"}}, + }, + Destinations: []*mesh_proto.Selector{ + {Match: mesh_proto.TagSelector{"kuma.io/service": "redis"}}, + }, + Conf: &mesh_proto.HealthCheck_Conf{ + Interval: ptypes.DurationProto(5 * time.Second), + Timeout: ptypes.DurationProto(4 * time.Second), + NoTrafficInterval: ptypes.DurationProto(6 * time.Second), + UnhealthyThreshold: 3, + HealthyThreshold: 2, + EventLogPath: "/event/log/path", + AlwaysLogHealthCheckFailures: &wrappers.BoolValue{Value: true}, + }, + }, + }, + expected: ` + connectTimeout: 5s + edsClusterConfig: + edsConfig: + ads: {} + resourceApiVersion: V3 + healthChecks: + - alwaysLogHealthCheckFailures: true + eventLogPath: /event/log/path + healthyThreshold: 2 + interval: 5s + noTrafficInterval: 6s + tcpHealthCheck: {} + timeout: 4s + unhealthyThreshold: 3 + name: testCluster type: EDS`, }), )