applied feedback

This commit is contained in:
trujillo-adam 2021-12-22 11:18:06 -08:00
parent 94da06f6ee
commit ec6aff8dc0
2 changed files with 140 additions and 9 deletions

View File

@ -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.
<CodeTabs heading="Example: Enabling gateways globally.">
```hcl
Kind = "proxy-defaults"
Name = "global"
@ -103,9 +105,19 @@ MeshGateway {
}
```
### Enabling Gateways Per-Service
```yaml
Kind: proxy-defaults
MeshGateway:
- Mode: local
Name: global
```
</CodeTabs>
The following `service-defaults` configuration will enable gateways for all Connect services with the name "web".
### Enabling Gateways Per Service
The following `service-defaults` configuration will enable gateways for all Connect services with the name `web`.
<CodeTabs heading="Example: Enabling gateways per service.">
```hcl
Kind = "service-defaults"
@ -115,11 +127,22 @@ MeshGateway {
}
```
```yaml
Kind: service-defaults
MeshGateway:
- Mode: local
Name: web
```
</CodeTabs>
### 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.
<CodeTabs heading="Example: Enabling gateways for a service instance.">
```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
```
</CodeTabs>
### 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.
<CodeTabs heading="Example: Enabling gateways for a proxy 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
```
</CodeTabs>

View File

@ -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.
<CodeTabs heading="Example: Enabling gateways globally.">
```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
</CodeTabs>
### Enabling Gateways Per Service
The following `service-defaults` configuration will enable gateways for all Connect services with the name `web`.
<CodeTabs heading="Example: Enabling gateways per service.">
```hcl
Kind = "service-defaults"
Name = "web"
@ -99,11 +110,21 @@ MeshGateway {
}
```
```yaml
Kind: service-defaults
MeshGateway:
- Mode: local
Name: web
```
</CodeTabs>
### 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.
<CodeTabs heading="Example: Enabling gateways for a service instance.">
```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
```
</CodeTabs>
### 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.
<CodeTabs heading="Example: Enabling gateways for a proxy upstream.">
```hcl
service {
name = "web-sidecar-proxy"
@ -170,3 +211,32 @@ 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>