diff --git a/website/content/docs/connect/gateways/mesh-gateway/service-to-service-traffic-datacenters.mdx b/website/content/docs/connect/gateways/mesh-gateway/service-to-service-traffic-datacenters.mdx index f7c153a345..6add2cee0a 100644 --- a/website/content/docs/connect/gateways/mesh-gateway/service-to-service-traffic-datacenters.mdx +++ b/website/content/docs/connect/gateways/mesh-gateway/service-to-service-traffic-datacenters.mdx @@ -95,6 +95,8 @@ Use the following example configurations to help you understand some of the comm The following `proxy-defaults` configuration will enable gateways for all Connect services in the `local` mode. + + ```hcl Kind = "proxy-defaults" Name = "global" @@ -103,9 +105,19 @@ MeshGateway { } ``` -### Enabling Gateways Per-Service +```yaml +Kind: proxy-defaults +MeshGateway: +- Mode: local +Name: global +``` + + +### Enabling Gateways Per Service + +The following `service-defaults` configuration will enable gateways for all Connect services with the name `web`. -The following `service-defaults` configuration will enable gateways for all Connect services with the name "web". + ```hcl Kind = "service-defaults" @@ -115,11 +127,22 @@ MeshGateway { } ``` +```yaml +Kind: service-defaults +MeshGateway: +- Mode: local +Name: web +``` + + + ### Enabling Gateways for a Service Instance The following [Proxy Service Registration](/docs/connect/registration/service-registration) definition will enable gateways for the service instance in the `remote` mode. + + ```hcl service { name = "web-sidecar-proxy" @@ -139,11 +162,9 @@ service { ] } } -``` -Or alternatively inline with the service definition: +# Or alternatively inline with the service definition: -```hcl service { name = "web" port = 8181 @@ -166,10 +187,28 @@ service { } ``` +```yaml +service: +- kind: connect-proxy + name: web-sidecar-proxy + port: 8181 + proxy: + - destination_service_name: web + mesh_gateway: + - mode: remote + upstreams: + - datacenter: secondary + destination_name: api + local_bind_port: 100 +``` + + + ### Enabling Gateways for a Proxy Upstream -The following service definition will enable gateways in the `local` mode for one upstream, the `remote` mode -for a second upstream and will disable gateways for a third upstream. +The following service definition will enable gateways in the `local` mode for one upstream, the `remote` mode for a second upstream and will disable gateways for a third upstream. + + ```hcl service { @@ -204,3 +243,25 @@ service { } } ``` +```yaml +service: +- kind: connect-proxy + name: web-sidecar-proxy + port: 8181 + proxy: + - destination_service_name: web + upstreams: + - destination_name: api + local_bind_port: 10000 + mesh_gateway: + - mode: remote + - destination_name: db + local_bind_port: 10001 + mesh_gateway: + - mode: local + - destination_name: logging + local_bind_port: 10002 + mesh_gateway: + - mode: none + ``` + \ No newline at end of file diff --git a/website/content/docs/connect/gateways/mesh-gateway/service-to-service-traffic-partitions.mdx b/website/content/docs/connect/gateways/mesh-gateway/service-to-service-traffic-partitions.mdx index 2a0b91751e..0191c8b192 100644 --- a/website/content/docs/connect/gateways/mesh-gateway/service-to-service-traffic-partitions.mdx +++ b/website/content/docs/connect/gateways/mesh-gateway/service-to-service-traffic-partitions.mdx @@ -79,6 +79,8 @@ Use the following example configurations to help you understand some of the comm The following `proxy-defaults` configuration will enable gateways for all Connect services in the `local` mode. + + ```hcl Kind = "proxy-defaults" Name = "global" @@ -86,11 +88,20 @@ MeshGateway { Mode = "local" } ``` +```yaml +Kind: proxy-defaults +MeshGateway: +- Mode: local +Name: global +``` + + -### Enabling Gateways Per-Service +### Enabling Gateways Per Service The following `service-defaults` configuration will enable gateways for all Connect services with the name `web`. + ```hcl Kind = "service-defaults" Name = "web" @@ -99,11 +110,21 @@ MeshGateway { } ``` +```yaml +Kind: service-defaults +MeshGateway: +- Mode: local +Name: web +``` + + ### Enabling Gateways for a Service Instance The following [Proxy Service Registration](/docs/connect/registration/service-registration) definition will enable gateways for `web` service instances in the `finance` partition. + + ```hcl service { name = "web-sidecar-proxy" @@ -127,10 +148,30 @@ service { } ``` +```yaml +service: +- kind: connect-proxy + name: web-sidecar-proxy + port: 8181 + proxy: + - destination_service_name: web + mesh_gateway: + - mode: local + upstreams: + - destination_name: billing + destination_namespace: default + destination_partition: finance + destination_type: service + local_bind_port: 9090 +``` + + ### Enabling Gateways for a Proxy Upstream The following service definition will enable gateways in `local` mode for three different partitions. Note that each service exists in the same namepace, but are separated by admin partition. + + ```hcl service { name = "web-sidecar-proxy" @@ -169,4 +210,33 @@ service { ] } } -``` \ No newline at end of file +``` + +```yaml +service: +- kind: connect-proxy + name: web-sidecar-proxy + port: 8181 + proxy: + - destination_service_name: web + upstreams: + - destination_name: api + destination_namespace: dev + destination_partition: api + local_bind_port: 10000 + mesh_gateway: + - mode: local + - destination_name: db + destination_namespace: dev + destination_partition: db + local_bind_port: 10001 + mesh_gateway: + - mode: local + - destination_name: logging + destination_namespace: dev + destination_partition: logging + local_bind_port: 10002 + mesh_gateway: + - mode: local +``` + \ No newline at end of file