2023-05-05 13:47:28 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package hashicorp.consul.mesh.v1alpha1;
|
|
|
|
|
|
|
|
import "pbcatalog/v1alpha1/selector.proto";
|
2023-07-13 19:06:56 +00:00
|
|
|
import "pbmesh/v1alpha1/upstreams_configuration.proto";
|
2023-05-05 13:47:28 +00:00
|
|
|
import "pbresource/resource.proto";
|
|
|
|
|
|
|
|
message Upstreams {
|
|
|
|
// Selection of workloads these upstreams should apply to.
|
|
|
|
// These can be prefixes or specific workload names.
|
|
|
|
hashicorp.consul.catalog.v1alpha1.WorkloadSelector workloads = 1;
|
|
|
|
|
2023-07-13 19:06:56 +00:00
|
|
|
// upstreams is the list of explicit upstreams to define for the selected workloads.
|
2023-05-05 13:47:28 +00:00
|
|
|
repeated Upstream upstreams = 2;
|
|
|
|
|
2023-07-13 19:06:56 +00:00
|
|
|
// pq_upstreams is the list of prepared query upstreams. This field is not supported directly in v2
|
|
|
|
// and should only be used for migration reasons.
|
|
|
|
repeated PreparedQueryUpstream pq_upstreams = 3;
|
2023-05-05 13:47:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message Upstream {
|
2023-07-13 19:06:56 +00:00
|
|
|
// destination_ref is the reference to an upstream service. This has to be pbcatalog.Service type.
|
|
|
|
hashicorp.consul.resource.Reference destination_ref = 1;
|
|
|
|
|
|
|
|
// destination_port is the port name of the upstream service. This should be the name
|
|
|
|
// 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
|
|
|
|
|
|
|
// datacenter is the datacenter for where this upstream service lives.
|
2023-05-05 13:47:28 +00:00
|
|
|
string datacenter = 3;
|
|
|
|
|
2023-07-13 19:06:56 +00:00
|
|
|
// listen_addr is the address where Envoy will listen for requests to this upstream.
|
|
|
|
// 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;
|
|
|
|
}
|
|
|
|
|
|
|
|
message PreparedQueryUpstream {
|
2023-07-13 19:06:56 +00:00
|
|
|
// name is the name of the prepared query to use as an upstream.
|
2023-05-05 13:47:28 +00:00
|
|
|
string name = 1;
|
2023-07-13 19:06:56 +00:00
|
|
|
|
|
|
|
// datacenter is the datacenter for where this upstream service lives.
|
2023-05-05 13:47:28 +00:00
|
|
|
string datacenter = 2;
|
|
|
|
|
2023-07-13 19:06:56 +00:00
|
|
|
// listen_addr is the address where Envoy will listen for requests to this upstream.
|
|
|
|
// 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;
|
|
|
|
}
|
|
|
|
|
|
|
|
UpstreamConfig upstream_config = 6;
|
|
|
|
}
|