2023-08-03 18:42:04 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
2023-08-21 17:31:54 +00:00
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
2023-08-03 18:42:04 +00:00
|
|
|
|
|
|
|
syntax = "proto3";
|
|
|
|
|
2023-09-22 16:51:15 +00:00
|
|
|
package hashicorp.consul.mesh.v2beta1;
|
2023-08-03 18:42:04 +00:00
|
|
|
|
2023-09-22 16:51:15 +00:00
|
|
|
import "pbmesh/v2beta1/common.proto";
|
2023-09-21 21:18:47 +00:00
|
|
|
import "pbresource/annotations.proto";
|
2023-08-03 18:42:04 +00:00
|
|
|
|
|
|
|
// NOTE: this should align to the GAMMA/gateway-api version, or at least be
|
|
|
|
// easily translatable.
|
|
|
|
//
|
|
|
|
// https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io/v1alpha2.TCPRoute
|
|
|
|
//
|
|
|
|
// This is a Resource type.
|
|
|
|
message TCPRoute {
|
2023-09-21 21:18:47 +00:00
|
|
|
option (hashicorp.consul.resource.spec) = {scope: SCOPE_NAMESPACE};
|
|
|
|
|
2023-09-22 23:41:49 +00:00
|
|
|
// ParentRefs references the resources (usually Services) that a Route wants
|
|
|
|
// to be attached to.
|
2023-08-03 18:42:04 +00:00
|
|
|
//
|
|
|
|
// It is invalid to reference an identical parent more than once. It is valid
|
2023-09-22 23:41:49 +00:00
|
|
|
// to reference multiple distinct sections within the same parent resource.
|
2023-08-03 18:42:04 +00:00
|
|
|
repeated ParentReference parent_refs = 1;
|
|
|
|
|
|
|
|
// Rules are a list of TCP matchers and actions.
|
|
|
|
repeated TCPRouteRule rules = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message TCPRouteRule {
|
|
|
|
// BackendRefs defines the backend(s) where matching requests should be sent.
|
|
|
|
// If unspecified or invalid (refers to a non-existent resource or a Service
|
|
|
|
// with no endpoints), the underlying implementation MUST actively reject
|
|
|
|
// connection attempts to this backend. Connection rejections must respect
|
|
|
|
// weight; if an invalid backend is requested to have 80% of connections,
|
|
|
|
// then 80% of connections must be rejected instead.
|
|
|
|
repeated TCPBackendRef backend_refs = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message TCPBackendRef {
|
|
|
|
BackendReference backend_ref = 1;
|
|
|
|
|
|
|
|
// Weight specifies the proportion of requests forwarded to the referenced
|
|
|
|
// backend. This is computed as weight/(sum of all weights in this
|
|
|
|
// BackendRefs list). For non-zero values, there may be some epsilon from the
|
|
|
|
// exact proportion defined here depending on the precision an implementation
|
|
|
|
// supports. Weight is not a percentage and the sum of weights does not need
|
|
|
|
// to equal 100.
|
|
|
|
//
|
2023-10-13 14:55:58 +00:00
|
|
|
// If only one backend is specified and it has a weight greater than 0, 100%
|
|
|
|
// of the traffic is forwarded to that backend. If weight is set to 0, no
|
|
|
|
// traffic should be forwarded for this entry. If unspecified, weight defaults
|
|
|
|
// to 1.
|
2023-08-03 18:42:04 +00:00
|
|
|
uint32 weight = 2;
|
|
|
|
}
|