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-10-13 14:55:58 +00:00
|
|
|
// Destinations is the list of explicit destinations to define for the selected workloads.
|
2023-09-25 18:03:45 +00:00
|
|
|
repeated Destination destinations = 2;
|
2023-05-05 13:47:28 +00:00
|
|
|
|
2023-10-13 14:55:58 +00:00
|
|
|
// PQDestinations 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 {
|
2023-10-13 14:55:58 +00:00
|
|
|
// DestinationRef 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;
|
|
|
|
|
2024-01-29 18:43:41 +00:00
|
|
|
// DestinationPort is the port of the destination service.
|
|
|
|
//
|
|
|
|
// For more details on potential values of this field, see documentation for Service.ServicePort.
|
2023-05-05 13:47:28 +00:00
|
|
|
string destination_port = 2;
|
2023-07-13 19:06:56 +00:00
|
|
|
|
2023-10-13 14:55:58 +00:00
|
|
|
// Datacenter is the datacenter for where this destination service lives.
|
2023-05-05 13:47:28 +00:00
|
|
|
string datacenter = 3;
|
|
|
|
|
2023-10-13 14:55:58 +00:00
|
|
|
// ListenAddr 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-10-13 14:55:58 +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
|
|
|
|
2023-10-13 14:55:58 +00:00
|
|
|
// Mode is the Unix file mode for the socket file. It should be provided
|
2023-07-13 19:06:56 +00:00
|
|
|
// 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 {
|
2023-10-13 14:55:58 +00:00
|
|
|
// 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-10-13 14:55:58 +00:00
|
|
|
// Datacenter is the datacenter for where this destination service lives.
|
2023-05-05 13:47:28 +00:00
|
|
|
string datacenter = 2;
|
|
|
|
|
2023-10-13 14:55:58 +00:00
|
|
|
// ListenAddr 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
|
|
|
}
|