applied feedback

pull/11859/head
trujillo-adam 3 years ago
parent 300daff089
commit e5b3be0597

@ -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. The following `proxy-defaults` configuration will enable gateways for all Connect services in the `local` mode.
<CodeTabs heading="Example: Enabling gateways globally.">
```hcl ```hcl
Kind = "proxy-defaults" Kind = "proxy-defaults"
Name = "global" Name = "global"
@ -103,9 +105,19 @@ MeshGateway {
} }
``` ```
### Enabling Gateways Per-Service ```yaml
Kind: proxy-defaults
MeshGateway:
- Mode: local
Name: global
```
</CodeTabs>
### 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". <CodeTabs heading="Example: Enabling gateways per service.">
```hcl ```hcl
Kind = "service-defaults" Kind = "service-defaults"
@ -115,11 +127,22 @@ MeshGateway {
} }
``` ```
```yaml
Kind: service-defaults
MeshGateway:
- Mode: local
Name: web
```
</CodeTabs>
### Enabling Gateways for a Service Instance ### Enabling Gateways for a Service Instance
The following [Proxy Service Registration](/docs/connect/registration/service-registration) The following [Proxy Service Registration](/docs/connect/registration/service-registration)
definition will enable gateways for the service instance in the `remote` mode. definition will enable gateways for the service instance in the `remote` mode.
<CodeTabs heading="Example: Enabling gateways for a service instance.">
```hcl ```hcl
service { service {
name = "web-sidecar-proxy" 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 { service {
name = "web" name = "web"
port = 8181 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
```
</CodeTabs>
### Enabling Gateways for a Proxy Upstream ### Enabling Gateways for a Proxy Upstream
The following service definition will enable gateways in the `local` mode for one upstream, the `remote` mode 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.
for a second upstream and will disable gateways for a third upstream.
<CodeTabs heading="Example: Enabling gateways for a proxy upstream.">
```hcl ```hcl
service { 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
```
</CodeTabs>

@ -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. The following `proxy-defaults` configuration will enable gateways for all Connect services in the `local` mode.
<CodeTabs heading="Example: Enabling gateways globally.">
```hcl ```hcl
Kind = "proxy-defaults" Kind = "proxy-defaults"
Name = "global" Name = "global"
@ -86,11 +88,20 @@ MeshGateway {
Mode = "local" Mode = "local"
} }
``` ```
```yaml
Kind: proxy-defaults
MeshGateway:
- Mode: local
Name: global
```
</CodeTabs>
### Enabling Gateways Per-Service ### 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`.
<CodeTabs heading="Example: Enabling gateways per service.">
```hcl ```hcl
Kind = "service-defaults" Kind = "service-defaults"
Name = "web" Name = "web"
@ -99,11 +110,21 @@ MeshGateway {
} }
``` ```
```yaml
Kind: service-defaults
MeshGateway:
- Mode: local
Name: web
```
</CodeTabs>
### Enabling Gateways for a Service Instance ### Enabling Gateways for a Service Instance
The following [Proxy Service Registration](/docs/connect/registration/service-registration) The following [Proxy Service Registration](/docs/connect/registration/service-registration)
definition will enable gateways for `web` service instances in the `finance` partition. definition will enable gateways for `web` service instances in the `finance` partition.
<CodeTabs heading="Example: Enabling gateways for a service instance.">
```hcl ```hcl
service { service {
name = "web-sidecar-proxy" 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
```
</CodeTabs>
### Enabling Gateways for a Proxy Upstream ### 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. 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.
<CodeTabs heading="Example: Enabling gateways for a proxy upstream.">
```hcl ```hcl
service { service {
name = "web-sidecar-proxy" name = "web-sidecar-proxy"
@ -169,4 +210,33 @@ service {
] ]
} }
} }
``` ```
```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
```
</CodeTabs>
Loading…
Cancel
Save