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.catalog.v2beta1;
|
2023-05-05 13:47:28 +00:00
|
|
|
|
|
2023-09-22 16:51:15 +00:00
|
|
|
|
import "pbcatalog/v2beta1/protocol.proto";
|
2023-09-21 21:18:47 +00:00
|
|
|
|
import "pbresource/annotations.proto";
|
2023-05-05 13:47:28 +00:00
|
|
|
|
|
|
|
|
|
// Workload is the representation of a unit of addressable work. This could
|
|
|
|
|
// represent a process on a VM, a Kubernetes pod or something else entirely.
|
|
|
|
|
message Workload {
|
2023-09-21 21:18:47 +00:00
|
|
|
|
option (hashicorp.consul.resource.spec) = {scope: SCOPE_NAMESPACE};
|
|
|
|
|
|
2023-05-05 13:47:28 +00:00
|
|
|
|
// addresses has a list of all workload addresses. This should include
|
|
|
|
|
// LAN and WAN addresses as well as any addresses a proxy would need
|
|
|
|
|
// to bind to (if different from the default address).
|
|
|
|
|
repeated WorkloadAddress addresses = 1;
|
|
|
|
|
|
|
|
|
|
// ports is a map from port name to workload port’s number and protocol.
|
|
|
|
|
map<string, WorkloadPort> ports = 2;
|
|
|
|
|
|
|
|
|
|
// node_name is the name of the node this workload belongs to.
|
|
|
|
|
string node_name = 3;
|
|
|
|
|
|
|
|
|
|
// identity is the name of the workload identity this workload is associated with.
|
|
|
|
|
string identity = 4;
|
|
|
|
|
|
|
|
|
|
// Locality specifies workload locality.
|
|
|
|
|
Locality locality = 5;
|
|
|
|
|
|
|
|
|
|
// Below fields are deprecated but kept here for backward compatibility reasons.
|
|
|
|
|
|
|
|
|
|
// deprecated: tags correspond to service tags that you can add to a service for DNS resolution.
|
|
|
|
|
repeated string tags = 6 [deprecated = true];
|
|
|
|
|
// deprecated: enable_tag_override indicates whether agents should be overriding tags during anti-entropy syncs.
|
|
|
|
|
bool enable_tag_override = 7 [deprecated = true];
|
|
|
|
|
// deprecated: connect_native indicates whether this workload is connect native which will allow it to be
|
|
|
|
|
// part of MeshEndpoints without having the corresponding Proxy resource.
|
|
|
|
|
bool connect_native = 8 [deprecated = true];
|
2024-01-18 16:37:42 +00:00
|
|
|
|
|
|
|
|
|
// dns contains any workload customization that will be returned in DNS discovery requests.
|
|
|
|
|
DNSPolicy dns = 9;
|
2023-05-05 13:47:28 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message WorkloadAddress {
|
|
|
|
|
// host can be an IP, DNS name or a unix socket.
|
|
|
|
|
// If it's a unix socket, only one port can be provided.
|
|
|
|
|
string host = 1;
|
|
|
|
|
|
|
|
|
|
// ports is a list of names of ports that this host binds to.
|
|
|
|
|
// If no ports are provided, we will assume all ports from the ports map.
|
|
|
|
|
repeated string ports = 2;
|
|
|
|
|
|
|
|
|
|
// external indicates whether this address should be used for external communication
|
|
|
|
|
// (aka a WAN address).
|
|
|
|
|
bool external = 3;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message WorkloadPort {
|
|
|
|
|
uint32 port = 1;
|
|
|
|
|
Protocol protocol = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message Locality {
|
|
|
|
|
// Region is region the zone belongs to.
|
|
|
|
|
string region = 1;
|
|
|
|
|
|
|
|
|
|
// Zone is the zone the entity is running in.
|
|
|
|
|
string zone = 2;
|
|
|
|
|
}
|
2024-01-18 16:37:42 +00:00
|
|
|
|
|
|
|
|
|
message DNSPolicy {
|
|
|
|
|
Weights weights = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message Weights {
|
|
|
|
|
uint32 passing = 1;
|
|
|
|
|
uint32 warning = 2;
|
|
|
|
|
}
|