dns_table.proto 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. syntax = "proto3";
  2. package envoy.data.dns.v3;
  3. import "envoy/type/matcher/v3/string.proto";
  4. import "google/protobuf/duration.proto";
  5. import "envoy/annotations/deprecation.proto";
  6. import "udpa/annotations/status.proto";
  7. import "udpa/annotations/versioning.proto";
  8. import "validate/validate.proto";
  9. option java_package = "io.envoyproxy.envoy.data.dns.v3";
  10. option java_outer_classname = "DnsTableProto";
  11. option java_multiple_files = true;
  12. option go_package = "github.com/envoyproxy/go-control-plane/envoy/data/dns/v3;dnsv3";
  13. option (udpa.annotations.file_status).package_version_status = ACTIVE;
  14. // [#protodoc-title: DNS Filter Table Data]
  15. // :ref:`DNS Filter config overview <config_udp_listener_filters_dns_filter>`.
  16. // This message contains the configuration for the DNS Filter if populated
  17. // from the control plane
  18. message DnsTable {
  19. option (udpa.annotations.versioning).previous_message_type = "envoy.data.dns.v2alpha.DnsTable";
  20. // This message contains a list of IP addresses returned for a query for a known name
  21. message AddressList {
  22. option (udpa.annotations.versioning).previous_message_type =
  23. "envoy.data.dns.v2alpha.DnsTable.AddressList";
  24. // This field contains a well formed IP address that is returned in the answer for a
  25. // name query. The address field can be an IPv4 or IPv6 address. Address family
  26. // detection is done automatically when Envoy parses the string. Since this field is
  27. // repeated, Envoy will return as many entries from this list in the DNS response while
  28. // keeping the response under 512 bytes
  29. repeated string address = 1 [(validate.rules).repeated = {
  30. min_items: 1
  31. items {string {min_len: 3}}
  32. }];
  33. }
  34. // Specify the service protocol using a numeric or string value
  35. message DnsServiceProtocol {
  36. oneof protocol_config {
  37. option (validate.required) = true;
  38. // Specify the protocol number for the service. Envoy will try to resolve the number to
  39. // the protocol name. For example, 6 will resolve to "tcp". Refer to:
  40. // https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml
  41. // for protocol names and numbers
  42. uint32 number = 1 [(validate.rules).uint32 = {lt: 255}];
  43. // Specify the protocol name for the service.
  44. string name = 2 [(validate.rules).string = {min_len: 1 well_known_regex: HTTP_HEADER_NAME}];
  45. }
  46. }
  47. // Specify the target for a given DNS service
  48. // [#next-free-field: 6]
  49. message DnsServiceTarget {
  50. // Specify the name of the endpoint for the Service. The name is a hostname or a cluster
  51. oneof endpoint_type {
  52. option (validate.required) = true;
  53. // Use a resolvable hostname as the endpoint for a service.
  54. string host_name = 1
  55. [(validate.rules).string = {min_len: 1 well_known_regex: HTTP_HEADER_NAME}];
  56. // Use a cluster name as the endpoint for a service.
  57. string cluster_name = 2
  58. [(validate.rules).string = {min_len: 1 well_known_regex: HTTP_HEADER_NAME}];
  59. }
  60. // The priority of the service record target
  61. uint32 priority = 3 [(validate.rules).uint32 = {lt: 65536}];
  62. // The weight of the service record target
  63. uint32 weight = 4 [(validate.rules).uint32 = {lt: 65536}];
  64. // The port to which the service is bound. This value is optional if the target is a
  65. // cluster. Setting port to zero in this case makes the filter use the port value
  66. // from the cluster host
  67. uint32 port = 5 [(validate.rules).uint32 = {lt: 65536}];
  68. }
  69. // This message defines a service selection record returned for a service query in a domain
  70. message DnsService {
  71. // The name of the service without the protocol or domain name
  72. string service_name = 1
  73. [(validate.rules).string = {min_len: 1 well_known_regex: HTTP_HEADER_NAME}];
  74. // The service protocol. This can be specified as a string or the numeric value of the protocol
  75. DnsServiceProtocol protocol = 2;
  76. // The service entry time to live. This is independent from the DNS Answer record TTL
  77. google.protobuf.Duration ttl = 3 [(validate.rules).duration = {gte {seconds: 1}}];
  78. // The list of targets hosting the service
  79. repeated DnsServiceTarget targets = 4 [(validate.rules).repeated = {min_items: 1}];
  80. }
  81. // Define a list of service records for a given service
  82. message DnsServiceList {
  83. repeated DnsService services = 1 [(validate.rules).repeated = {min_items: 1}];
  84. }
  85. message DnsEndpoint {
  86. option (udpa.annotations.versioning).previous_message_type =
  87. "envoy.data.dns.v2alpha.DnsTable.DnsEndpoint";
  88. oneof endpoint_config {
  89. option (validate.required) = true;
  90. // Define a list of addresses to return for the specified endpoint
  91. AddressList address_list = 1;
  92. // Define a cluster whose addresses are returned for the specified endpoint
  93. string cluster_name = 2;
  94. // Define a DNS Service List for the specified endpoint
  95. DnsServiceList service_list = 3;
  96. }
  97. }
  98. message DnsVirtualDomain {
  99. option (udpa.annotations.versioning).previous_message_type =
  100. "envoy.data.dns.v2alpha.DnsTable.DnsVirtualDomain";
  101. // A domain name for which Envoy will respond to query requests
  102. string name = 1 [(validate.rules).string = {min_len: 1 well_known_regex: HTTP_HEADER_NAME}];
  103. // The configuration containing the method to determine the address of this endpoint
  104. DnsEndpoint endpoint = 2;
  105. // Sets the TTL in DNS answers from Envoy returned to the client. The default TTL is 300s
  106. google.protobuf.Duration answer_ttl = 3 [(validate.rules).duration = {gte {seconds: 30}}];
  107. }
  108. // Control how many times Envoy makes an attempt to forward a query to an external DNS server
  109. uint32 external_retry_count = 1 [(validate.rules).uint32 = {lte: 3}];
  110. // Fully qualified domain names for which Envoy will respond to DNS queries. By leaving this
  111. // list empty, Envoy will forward all queries to external resolvers
  112. repeated DnsVirtualDomain virtual_domains = 2;
  113. // This field is deprecated and no longer used in Envoy. The filter's behavior has changed
  114. // internally to use a different data structure allowing the filter to determine whether a
  115. // query is for known domain without the use of this field.
  116. //
  117. // This field serves to help Envoy determine whether it can authoritatively answer a query
  118. // for a name matching a suffix in this list. If the query name does not match a suffix in
  119. // this list, Envoy will forward the query to an upstream DNS server
  120. repeated type.matcher.v3.StringMatcher known_suffixes = 3
  121. [deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
  122. }