2023-05-05 13:47:28 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
2023-08-21 17:31:54 +00:00
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
2023-05-05 13:47:28 +00:00
|
|
|
|
|
|
|
syntax = "proto3";
|
|
|
|
|
2023-09-22 16:51:15 +00:00
|
|
|
package hashicorp.consul.mesh.v2beta1;
|
2023-05-05 13:47:28 +00:00
|
|
|
|
2023-09-22 16:51:15 +00:00
|
|
|
import "pbcatalog/v2beta1/selector.proto";
|
2023-09-25 18:03:45 +00:00
|
|
|
import "pbmesh/v2beta1/destinations_configuration.proto";
|
2023-09-21 21:18:47 +00:00
|
|
|
import "pbresource/annotations.proto";
|
2023-05-05 13:47:28 +00:00
|
|
|
import "pbresource/resource.proto";
|
|
|
|
|
2023-09-25 18:03:45 +00:00
|
|
|
message Destinations {
|
2023-09-21 21:18:47 +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-05-05 13:47:28 +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-05-05 13:47:28 +00:00
|
|
|
|
2023-09-25 18:03:45 +00:00
|
|
|
// destinations is the list of explicit destinations to define for the selected workloads.
|
|
|
|
repeated Destination destinations = 2;
|
2023-05-05 13:47:28 +00:00
|
|
|
|
2023-09-25 18:03:45 +00:00
|
|
|
// pq_destinations is the list of prepared query destinations. This field is not supported directly in v2
|
2023-07-13 19:06:56 +00:00
|
|
|
// and should only be used for migration reasons.
|
2023-09-25 18:03:45 +00:00
|
|
|
repeated PreparedQueryDestination pq_destinations = 3;
|
2023-05-05 13:47:28 +00:00
|
|
|
}
|
|
|
|
|
2023-09-25 18:03:45 +00:00
|
|
|
message Destination {
|
|
|
|
// destination_ref is the reference to an destination service. This has to be pbcatalog.Service type.
|
2023-07-13 19:06:56 +00:00
|
|
|
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
|
2023-07-13 19:06:56 +00:00
|
|
|
// of the service's target port.
|
2023-05-05 13:47:28 +00:00
|
|
|
string destination_port = 2;
|
2023-07-13 19:06:56 +00:00
|
|
|
|
2023-09-25 18:03:45 +00:00
|
|
|
// datacenter is the datacenter for where this destination service lives.
|
2023-05-05 13:47:28 +00:00
|
|
|
string datacenter = 3;
|
|
|
|
|
2023-09-25 18:03:45 +00:00
|
|
|
// listen_addr is the address where Envoy will listen for requests to this destination.
|
2023-07-13 19:06:56 +00:00
|
|
|
// It can provided either as an ip:port or as a Unix domain socket.
|
2023-05-05 13:47:28 +00:00
|
|
|
oneof listen_addr {
|
2023-07-13 19:06:56 +00:00
|
|
|
IPPortAddress ip_port = 4;
|
2023-05-05 13:47:28 +00:00
|
|
|
UnixSocketAddress unix = 5;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-13 19:06:56 +00:00
|
|
|
message IPPortAddress {
|
|
|
|
// ip is an IPv4 or an IPv6 address.
|
2023-05-05 13:47:28 +00:00
|
|
|
string ip = 1;
|
2023-07-13 19:06:56 +00:00
|
|
|
|
|
|
|
// port is the port number.
|
2023-05-05 13:47:28 +00:00
|
|
|
uint32 port = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message UnixSocketAddress {
|
2023-07-13 19:06:56 +00:00
|
|
|
// path is the file system path at which to bind a Unix domain socket listener.
|
2023-05-05 13:47:28 +00:00
|
|
|
string path = 1;
|
2023-07-13 19:06:56 +00:00
|
|
|
|
|
|
|
// mode is the Unix file mode for the socket file. It should be provided
|
|
|
|
// in the numeric notation, for example, "0600".
|
2023-05-05 13:47:28 +00:00
|
|
|
string mode = 2;
|
|
|
|
}
|
|
|
|
|
2023-09-25 18:03:45 +00:00
|
|
|
message PreparedQueryDestination {
|
|
|
|
// name is the name of the prepared query to use as an destination.
|
2023-05-05 13:47:28 +00:00
|
|
|
string name = 1;
|
2023-07-13 19:06:56 +00:00
|
|
|
|
2023-09-25 18:03:45 +00:00
|
|
|
// datacenter is the datacenter for where this destination service lives.
|
2023-05-05 13:47:28 +00:00
|
|
|
string datacenter = 2;
|
|
|
|
|
2023-09-25 18:03:45 +00:00
|
|
|
// listen_addr is the address where Envoy will listen for requests to this destination.
|
2023-07-13 19:06:56 +00:00
|
|
|
// It can provided either as an ip:port or as a Unix domain socket.
|
2023-05-05 13:47:28 +00:00
|
|
|
oneof listen_addr {
|
2023-07-13 19:06:56 +00:00
|
|
|
IPPortAddress tcp = 4;
|
2023-05-05 13:47:28 +00:00
|
|
|
UnixSocketAddress unix = 5;
|
|
|
|
}
|
|
|
|
|
2023-09-25 18:03:45 +00:00
|
|
|
DestinationConfiguration destination_config = 6;
|
2023-05-05 13:47:28 +00:00
|
|
|
}
|