mirror of
https://github.com/status-im/consul.git
synced 2025-01-11 06:16:08 +00:00
92aab7ea31
[OG Author: michael.zalimeni@hashicorp.com, rebase needed a separate PR] * v2: support virtual port in Service port references In addition to Service target port references, allow users to specify a port by stringified virtual port value. This is useful in environments such as Kubernetes where typical configuration is written in terms of Service virtual ports rather than workload (pod) target port names. Retaining the option of referencing target ports by name supports VMs, Nomad, and other use cases where virtual ports are not used by default. To support both uses cases at once, we will strictly interpret port references based on whether the value is numeric. See updated `ServicePort` docs for more details. * v2: update service ref docs for virtual port support Update proto and generated .go files with docs reflecting virtual port reference support. * v2: add virtual port references to L7 topo test Add coverage for mixed virtual and target port references to existing test. * update failover policy controller tests to work with computed failover policy and assert error conditions against FailoverPolicy and ComputedFailoverPolicy resources * accumulate services; don't overwrite them in enterprise --------- Co-authored-by: Michael Zalimeni <michael.zalimeni@hashicorp.com> Co-authored-by: R.B. Boyer <rb@hashicorp.com>
81 lines
2.6 KiB
Protocol Buffer
81 lines
2.6 KiB
Protocol Buffer
// Copyright (c) HashiCorp, Inc.
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
syntax = "proto3";
|
|
|
|
package hashicorp.consul.mesh.v2beta1;
|
|
|
|
import "pbcatalog/v2beta1/selector.proto";
|
|
import "pbmesh/v2beta1/destinations_configuration.proto";
|
|
import "pbresource/annotations.proto";
|
|
import "pbresource/resource.proto";
|
|
|
|
message Destinations {
|
|
option (hashicorp.consul.resource.spec) = {scope: SCOPE_NAMESPACE};
|
|
|
|
// Selection of workloads these destinations should apply to.
|
|
// These can be prefixes or specific workload names.
|
|
hashicorp.consul.catalog.v2beta1.WorkloadSelector workloads = 1;
|
|
|
|
// Destinations is the list of explicit destinations to define for the selected workloads.
|
|
repeated Destination destinations = 2;
|
|
|
|
// PQDestinations is the list of prepared query destinations. This field is not supported directly in v2
|
|
// and should only be used for migration reasons.
|
|
repeated PreparedQueryDestination pq_destinations = 3;
|
|
}
|
|
|
|
message Destination {
|
|
// DestinationRef is the reference to an destination service. This has to be pbcatalog.Service type.
|
|
hashicorp.consul.resource.Reference destination_ref = 1;
|
|
|
|
// DestinationPort is the port of the destination service.
|
|
//
|
|
// For more details on potential values of this field, see documentation for Service.ServicePort.
|
|
string destination_port = 2;
|
|
|
|
// Datacenter is the datacenter for where this destination service lives.
|
|
string datacenter = 3;
|
|
|
|
// ListenAddr is the address where Envoy will listen for requests to this destination.
|
|
// It can provided either as an ip:port or as a Unix domain socket.
|
|
oneof listen_addr {
|
|
IPPortAddress ip_port = 4;
|
|
UnixSocketAddress unix = 5;
|
|
}
|
|
}
|
|
|
|
message IPPortAddress {
|
|
// ip is an IPv4 or an IPv6 address.
|
|
string ip = 1;
|
|
|
|
// port is the port number.
|
|
uint32 port = 2;
|
|
}
|
|
|
|
message UnixSocketAddress {
|
|
// Path is the file system path at which to bind a Unix domain socket listener.
|
|
string path = 1;
|
|
|
|
// Mode is the Unix file mode for the socket file. It should be provided
|
|
// in the numeric notation, for example, "0600".
|
|
string mode = 2;
|
|
}
|
|
|
|
message PreparedQueryDestination {
|
|
// Name is the name of the prepared query to use as an destination.
|
|
string name = 1;
|
|
|
|
// Datacenter is the datacenter for where this destination service lives.
|
|
string datacenter = 2;
|
|
|
|
// ListenAddr is the address where Envoy will listen for requests to this destination.
|
|
// It can provided either as an ip:port or as a Unix domain socket.
|
|
oneof listen_addr {
|
|
IPPortAddress tcp = 4;
|
|
UnixSocketAddress unix = 5;
|
|
}
|
|
|
|
DestinationConfiguration destination_config = 6;
|
|
}
|