2023-07-13 19:06:56 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
2023-08-21 17:31:54 +00:00
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
2023-07-13 19:06:56 +00:00
|
|
|
|
|
|
|
syntax = "proto3";
|
|
|
|
|
2023-09-22 16:51:15 +00:00
|
|
|
package hashicorp.consul.mesh.v2beta1;
|
2023-07-13 19:06:56 +00:00
|
|
|
|
|
|
|
import "google/protobuf/duration.proto";
|
2023-07-21 16:21:39 +00:00
|
|
|
import "google/protobuf/wrappers.proto";
|
2023-09-22 16:51:15 +00:00
|
|
|
import "pbcatalog/v2beta1/protocol.proto";
|
|
|
|
import "pbcatalog/v2beta1/selector.proto";
|
|
|
|
import "pbmesh/v2beta1/connection.proto";
|
|
|
|
import "pbmesh/v2beta1/routing.proto";
|
2023-09-22 21:50:56 +00:00
|
|
|
import "pbresource/annotations.proto";
|
2023-07-13 19:06:56 +00:00
|
|
|
import "pbresource/resource.proto";
|
|
|
|
|
2023-09-25 18:03:45 +00:00
|
|
|
message DestinationsConfiguration {
|
2023-09-22 21:50:56 +00:00
|
|
|
option (hashicorp.consul.resource.spec) = {scope: SCOPE_NAMESPACE};
|
|
|
|
|
2023-09-25 18:03:45 +00:00
|
|
|
// Selection of workloads these destinations should apply to.
|
2023-07-13 19:06:56 +00:00
|
|
|
// These can be prefixes or specific workload names.
|
2023-09-22 16:51:15 +00:00
|
|
|
hashicorp.consul.catalog.v2beta1.WorkloadSelector workloads = 1;
|
2023-07-13 19:06:56 +00:00
|
|
|
|
2023-09-25 18:03:45 +00:00
|
|
|
// default_config applies to all destinations for the workloads selected by this resource.
|
|
|
|
DestinationConfiguration default_config = 2;
|
2023-07-13 19:06:56 +00:00
|
|
|
|
2023-09-25 18:03:45 +00:00
|
|
|
// config_overrides provides per-destination or per-destination-port config overrides.
|
|
|
|
repeated DestinationConfigOverrides config_overrides = 3;
|
2023-07-13 19:06:56 +00:00
|
|
|
}
|
|
|
|
|
2023-09-25 18:03:45 +00:00
|
|
|
// UpstreamConfigOverrides allow to override destination configuration per destination_ref/port/datacenter.
|
2023-07-13 19:06:56 +00:00
|
|
|
// In that sense, those three fields (destination_ref, destination_port and datacenter) are treated
|
|
|
|
// sort of like map keys and config is a like a map value for that key.
|
2023-09-25 18:03:45 +00:00
|
|
|
message DestinationConfigOverrides {
|
|
|
|
// destination_ref is the reference to an destination service that this configuration applies to.
|
2023-07-13 19:06:56 +00:00
|
|
|
// This has to be pbcatalog.Service type.
|
|
|
|
hashicorp.consul.resource.Reference destination_ref = 1;
|
|
|
|
|
2023-09-25 18:03:45 +00:00
|
|
|
// destination_port is the port name of the destination service. This should be the name
|
|
|
|
// of the service's target port. If not provided, this configuration will apply to all ports of an destination.
|
2023-07-13 19:06:56 +00:00
|
|
|
string destination_port = 2;
|
|
|
|
|
2023-09-25 18:03:45 +00:00
|
|
|
// datacenter is the datacenter for where this destination service lives.
|
2023-07-13 19:06:56 +00:00
|
|
|
string datacenter = 3;
|
|
|
|
|
2023-09-25 18:03:45 +00:00
|
|
|
// config is the configuration that should apply to this destination.
|
|
|
|
DestinationConfiguration config = 4;
|
2023-07-13 19:06:56 +00:00
|
|
|
}
|
|
|
|
|
2023-09-25 18:03:45 +00:00
|
|
|
message DestinationConfiguration {
|
|
|
|
// protocol overrides destination's port protocol. If no port for an destination is specified
|
2023-07-13 19:06:56 +00:00
|
|
|
// or if used in the default configuration, this protocol will be used for all ports
|
2023-09-25 18:03:45 +00:00
|
|
|
// or for all ports of all destinations respectively.
|
2023-09-22 16:51:15 +00:00
|
|
|
hashicorp.consul.catalog.v2beta1.Protocol protocol = 1;
|
2023-07-13 19:06:56 +00:00
|
|
|
|
|
|
|
// connect_timeout is the timeout used when making a new
|
2023-09-25 18:03:45 +00:00
|
|
|
// connection to this destination. Defaults to 5 seconds if not set.
|
2023-07-13 19:06:56 +00:00
|
|
|
google.protobuf.Duration connect_timeout = 2;
|
|
|
|
|
2023-09-25 18:03:45 +00:00
|
|
|
// limits are the set of limits that are applied to the proxy for a specific destination.
|
|
|
|
DestinationLimits limits = 3;
|
2023-07-13 19:06:56 +00:00
|
|
|
|
2023-09-25 18:03:45 +00:00
|
|
|
// passive_health_check configuration determines how destination proxy instances will
|
2023-07-13 19:06:56 +00:00
|
|
|
// be monitored for removal from the load balancing pool.
|
|
|
|
PassiveHealthCheck passive_health_check = 4;
|
|
|
|
|
|
|
|
// balance_outbound_connections indicates how the proxy should attempt to distribute
|
|
|
|
// connections across worker threads.
|
|
|
|
BalanceConnections balance_outbound_connections = 5;
|
|
|
|
|
|
|
|
// MeshGatewayMode is the Mesh Gateway routing mode.
|
|
|
|
MeshGatewayMode mesh_gateway_mode = 6;
|
|
|
|
}
|
|
|
|
|
|
|
|
// UpstreamLimits describes the limits that are associated with a specific
|
2023-09-25 18:03:45 +00:00
|
|
|
// destination of a service instance.
|
|
|
|
message DestinationLimits {
|
2023-07-13 19:06:56 +00:00
|
|
|
// max_connections is the maximum number of connections the local proxy can
|
2023-09-25 18:03:45 +00:00
|
|
|
// make to the destination service.
|
2023-07-21 16:21:39 +00:00
|
|
|
google.protobuf.UInt32Value max_connections = 1;
|
2023-07-13 19:06:56 +00:00
|
|
|
|
|
|
|
// max_pending_requests is the maximum number of requests that will be queued
|
|
|
|
// waiting for an available connection. This is mostly applicable to HTTP/1.1
|
|
|
|
// clusters since all HTTP/2 requests are streamed over a single
|
|
|
|
// connection.
|
2023-07-21 16:21:39 +00:00
|
|
|
google.protobuf.UInt32Value max_pending_requests = 2;
|
2023-07-13 19:06:56 +00:00
|
|
|
|
|
|
|
// max_concurrent_requests is the maximum number of in-flight requests that will be allowed
|
2023-09-25 18:03:45 +00:00
|
|
|
// to the destination cluster at a point in time. This is mostly applicable to HTTP/2
|
2023-07-13 19:06:56 +00:00
|
|
|
// clusters since all HTTP/1.1 requests are limited by MaxConnections.
|
2023-07-21 16:21:39 +00:00
|
|
|
google.protobuf.UInt32Value max_concurrent_requests = 3;
|
2023-07-13 19:06:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message PassiveHealthCheck {
|
|
|
|
// interval between health check analysis sweeps. Each sweep may remove
|
|
|
|
// hosts or return hosts to the pool.
|
|
|
|
google.protobuf.Duration interval = 1;
|
|
|
|
|
|
|
|
// max_failures is the count of consecutive failures that results in a host
|
|
|
|
// being removed from the pool.
|
|
|
|
uint32 max_failures = 2;
|
|
|
|
|
|
|
|
// enforcing_consecutive_5xx is the % chance that a host will be actually ejected
|
|
|
|
// when an outlier status is detected through consecutive 5xx.
|
|
|
|
// This setting can be used to disable ejection or to ramp it up slowly. Defaults to 100.
|
|
|
|
uint32 enforcing_consecutive_5xx = 3;
|
|
|
|
}
|