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-10-13 14:55:58 +00:00
|
|
|
// DefaultConfig applies to all destinations for the workloads selected by this resource.
|
2023-09-25 18:03:45 +00:00
|
|
|
DestinationConfiguration default_config = 2;
|
2023-07-13 19:06:56 +00:00
|
|
|
|
2023-10-13 14:55:58 +00:00
|
|
|
// ConfigOverrides provides per-destination or per-destination-port config overrides.
|
2023-09-25 18:03:45 +00:00
|
|
|
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 {
|
2023-10-13 14:55:58 +00:00
|
|
|
// DestinationRef 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-10-13 14:55:58 +00:00
|
|
|
// DestinationPort is the port name of the destination service. This should be the name
|
2023-09-25 18:03:45 +00:00
|
|
|
// 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-10-13 14:55:58 +00:00
|
|
|
// Datacenter is the datacenter for where this destination service lives.
|
2023-07-13 19:06:56 +00:00
|
|
|
string datacenter = 3;
|
|
|
|
|
2023-10-13 14:55:58 +00:00
|
|
|
// Config is the configuration that should apply to this destination.
|
2023-09-25 18:03:45 +00:00
|
|
|
DestinationConfiguration config = 4;
|
2023-07-13 19:06:56 +00:00
|
|
|
}
|
|
|
|
|
2023-09-25 18:03:45 +00:00
|
|
|
message DestinationConfiguration {
|
2023-10-13 14:55:58 +00:00
|
|
|
// 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
|
|
|
|
2023-10-13 14:55:58 +00:00
|
|
|
// ConnectTimeout 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-10-13 14:55:58 +00:00
|
|
|
// +kubebuilder:validation:Format=duration
|
2023-07-13 19:06:56 +00:00
|
|
|
google.protobuf.Duration connect_timeout = 2;
|
|
|
|
|
2023-10-13 14:55:58 +00:00
|
|
|
// Limits are the set of limits that are applied to the proxy for a specific destination.
|
2023-09-25 18:03:45 +00:00
|
|
|
DestinationLimits limits = 3;
|
2023-07-13 19:06:56 +00:00
|
|
|
|
2023-10-13 14:55:58 +00:00
|
|
|
// PassiveHealthCheck 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;
|
|
|
|
|
2023-10-13 14:55:58 +00:00
|
|
|
// BalanceOutboundConnections indicates how the proxy should attempt to distribute
|
2023-07-13 19:06:56 +00:00
|
|
|
// 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-10-13 14:55:58 +00:00
|
|
|
// MaxConnections 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
|
|
|
|
2023-10-13 14:55:58 +00:00
|
|
|
// MaxPendingRequests is the maximum number of requests that will be queued
|
2023-07-13 19:06:56 +00:00
|
|
|
// 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
|
|
|
|
2023-10-13 14:55:58 +00:00
|
|
|
// MaxConcurrentRequests 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 {
|
2023-10-13 14:55:58 +00:00
|
|
|
// Interval between health check analysis sweeps. Each sweep may remove
|
2023-07-13 19:06:56 +00:00
|
|
|
// hosts or return hosts to the pool.
|
2023-10-13 14:55:58 +00:00
|
|
|
// +kubebuilder:validation:Format=duration
|
2023-07-13 19:06:56 +00:00
|
|
|
google.protobuf.Duration interval = 1;
|
|
|
|
|
2023-10-13 14:55:58 +00:00
|
|
|
// MaxFailures is the count of consecutive failures that results in a host
|
2023-07-13 19:06:56 +00:00
|
|
|
// being removed from the pool.
|
|
|
|
uint32 max_failures = 2;
|
|
|
|
|
2023-10-13 14:55:58 +00:00
|
|
|
// EnforcingConsecutive5XX is the % chance that a host will be actually ejected
|
2023-07-13 19:06:56 +00:00
|
|
|
// 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;
|
|
|
|
}
|