TCP route configuration Reference

This topic provides reference information for the gateway TCP routes configuration entry. Refer to Route Resource Configuration for information about configuring API gateways in Kubernetes environments.

Configuration model

The following list outlines field hierarchy, language-specific data types, and requirements in an tcp-route configuration entry. Click on a property name to view additional details, including default values.

  • Kind: string | must be "tcp-route"
  • Name: string | no default
  • Namespace: string | no default EnterpriseTCP Route - 图1Enterprise
  • Partition: string | no default EnterpriseTCP Route - 图2Enterprise
  • Meta: map | no default
  • Services: list | no default
    • Name: string | no default
    • Namespace: string | no default EnterpriseTCP Route - 图3Enterprise
    • Partition: string | no default EnterpriseTCP Route - 图4Enterprise
  • Parents: list | no default
    • Kind: string | must be "api-gateway"
    • Name: string | no default
    • Namespace: string | no default EnterpriseTCP Route - 图5Enterprise
    • Partition: string | no default EnterpriseTCP Route - 图6Enterprise
    • SectionName: string | no default

Complete configuration

When every field is defined, a tcp-route configuration entry has the following form:

  1. Kind = "tcp-route"
  2. Name = "<name of the route>"
  3. Namespace = "<enterprise: namespace of the route>"
  4. Partition = "<enterprise: partition of the route>"
  5. Meta = {
  6. "<any key>" = "<any value>"
  7. }
  8. Services = [
  9. {
  10. Name = "<name of service>"
  11. Namespace = "<enterprise: namespace of the service>"
  12. Partition = "<enterprise: partition of the service>"
  13. }
  14. ]
  15. Parents = [
  16. {
  17. Kind = "api-gateway"
  18. Name = "<name of the api-gateway to bind to>"
  19. Namespace = "<enterprise: namespace of the parent>"
  20. Partition = "<enterprise: partition of the parent>"
  21. SectionName = "<listener on the api-gateway to bind to>"
  22. }
  23. ]
  1. {
  2. "Kind": "tcp-route",
  3. "Name": "<name of the route>",
  4. "Namespace": "<enterprise: namespace of the route>",
  5. "Partition": "<enterprise: partition of the route>",
  6. "Meta": {
  7. "<any key>": "<any value>"
  8. },
  9. "Services": [
  10. {
  11. "Name": "<name of service>"
  12. "Namespace": "<enterprise: namespace of the service>",
  13. "Partition": "<enterprise: partition of the service>",
  14. }
  15. ],
  16. "Parents": [
  17. {
  18. "Kind": "api-gateway",
  19. "Name": "<name of the api-gateway to bind to>",
  20. "Namespace": "<enterprise: namespace of the parent>",
  21. "Partition": "<enterprise: partition of the parent>",
  22. "SectionName": "<listener on the api-gateway to bind to>"
  23. }
  24. ]
  25. }

Specification

This section provides details about the fields you can configure in the tcp-route configuration entry.

Kind

Specifies the type of configuration entry to implement. This must be set to "tcp-route".

Values

  • Default: none
  • This field is required.
  • Data type: string value that must be set totcp-route.

Name

Specifies a name for the configuration entry. The name is metadata that you can use to reference the configuration entry when performing Consul operations, such as applying a configuration entry to a specific cluster.

Values

  • Default: Defaults to the name of the node after writing the entry to the Consul server.
  • This field is required.
  • Data type: string

Namespace EnterpriseTCP Route - 图7Enterprise

Specifies the Enterprise namespace to apply to the configuration entry.

Values

  • Default: "default" in Enterprise
  • Data type: string

Partition EnterpriseTCP Route - 图8Enterprise

Specifies the Enterprise admin partition to apply to the configuration entry.

Values

  • Default: "default" in Enterprise
  • Data type: string

Meta

Specifies an arbitrary set of key-value pairs to associate with the gateway.

Values

  • Default: none
  • Data type: map containing one or more keys and string values.

Services

Specifies a TCP-based service the API gateway routes incoming requests to. You can only specify one service.

Values

  • Default: none
  • The data type is a list of maps. Each member of the list contains the following fields:

Services.Name

Specifies the list of TCP-based services to route to. You can specify a maximum of one service.

Values

  • Default: none
  • Data type: string

Services.Namespace EnterpriseTCP Route - 图11Enterprise

Specifies the Enterprise namespace where the service is located.

Values

  • Default: "default" in Enterprise
  • Data type: string

Services.Partition EnterpriseTCP Route - 图12Enterprise

Specifies the Enterprise admin partition where the service is located.

Values

  • Default: "default" in Enterprise
  • Data type: string

Parents

Specifies the list of gateways that the route is bound to.

Values

Parents.Kind

Specifies the type of resource to bind to. This field is required and must be set to "api-gateway"

Values

  • Default: none
  • This field is required.
  • Data type: string

Parents.Name

Specifies the name of the API gateway to bind to.

Values

  • Default: none
  • This field is required.
  • Data type: string

Parents.Namespace EnterpriseTCP Route - 图15Enterprise

Specifies the Enterprise namespace where the parent is located.

Values

  • Default: "default" in Enterprise
  • Data type: string

Parents.Partition EnterpriseTCP Route - 图16Enterprise

Specifies the Enterprise admin partition where the parent is located.

Values

  • Default: "default" in Enterprise
  • Data type: string

Parents.SectionName

Specifies the name of the listener defined in the api-gateway configuration that the route binds to. If the field is configured to an empty string, the route binds to all listeners on the parent gateway.

Values

  • Default: ""
  • Data type: string