Merge pull request #6434 from hashicorp/docs-add-grpc-info
docs: Added grpc info; small style fixes to connect guide
This commit is contained in:
commit
ae8bfce399
|
@ -56,6 +56,40 @@ run in dev mode with the following command:
|
|||
$ consul agent -dev
|
||||
```
|
||||
|
||||
To use Connect on a non-dev Consul agent, you will minimally need to enable the
|
||||
GRPC port and set `connect` to enabled by adding some additional information to
|
||||
your Consul client configurations, depending on format.
|
||||
|
||||
For HCL configurations:
|
||||
|
||||
```hcl
|
||||
# ...
|
||||
|
||||
ports {
|
||||
"grpc" = 8502
|
||||
}
|
||||
|
||||
connect {
|
||||
enabled = true
|
||||
}
|
||||
```
|
||||
|
||||
For JSON configurations:
|
||||
|
||||
```javascript
|
||||
{
|
||||
// ...
|
||||
"ports": {
|
||||
"grpc": 8502
|
||||
},
|
||||
"connect": {
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Nomad
|
||||
|
||||
Nomad must schedule onto a routable interface in order for the proxies to
|
||||
|
@ -87,8 +121,9 @@ to Nomad by copying the HCL into a file named `connect.nomad` and running:
|
|||
`nomad run connect.nomad`
|
||||
|
||||
```hcl
|
||||
job "countdash" {
|
||||
job "countdash" {
|
||||
datacenters = ["dc1"]
|
||||
|
||||
group "api" {
|
||||
network {
|
||||
mode = "bridge"
|
||||
|
@ -105,6 +140,7 @@ to Nomad by copying the HCL into a file named `connect.nomad` and running:
|
|||
|
||||
task "web" {
|
||||
driver = "docker"
|
||||
|
||||
config {
|
||||
image = "hashicorpnomad/counter-api:v1"
|
||||
}
|
||||
|
@ -114,6 +150,7 @@ to Nomad by copying the HCL into a file named `connect.nomad` and running:
|
|||
group "dashboard" {
|
||||
network {
|
||||
mode = "bridge"
|
||||
|
||||
port "http" {
|
||||
static = 9002
|
||||
to = 9002
|
||||
|
@ -138,15 +175,17 @@ to Nomad by copying the HCL into a file named `connect.nomad` and running:
|
|||
|
||||
task "dashboard" {
|
||||
driver = "docker"
|
||||
|
||||
env {
|
||||
COUNTING_SERVICE_URL = "http://${NOMAD_UPSTREAM_ADDR_count_api}"
|
||||
}
|
||||
|
||||
config {
|
||||
image = "hashicorpnomad/counter-dashboard:v1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The job contains two task groups: an API service and a web frontend.
|
||||
|
@ -161,7 +200,7 @@ The API service is defined as a task group with a bridge network:
|
|||
mode = "bridge"
|
||||
}
|
||||
|
||||
...
|
||||
# ...
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -170,7 +209,8 @@ any ports in its network. The service stanza enables Connect:
|
|||
|
||||
```hcl
|
||||
group "api" {
|
||||
...
|
||||
|
||||
# ...
|
||||
|
||||
service {
|
||||
name = "count-api"
|
||||
|
@ -181,7 +221,8 @@ any ports in its network. The service stanza enables Connect:
|
|||
}
|
||||
}
|
||||
|
||||
...
|
||||
# ...
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -197,14 +238,16 @@ forwarded port:
|
|||
```hcl
|
||||
group "dashboard" {
|
||||
network {
|
||||
mode ="bridge"
|
||||
mode = "bridge"
|
||||
|
||||
port "http" {
|
||||
static = 9002
|
||||
to = 9002
|
||||
}
|
||||
}
|
||||
|
||||
...
|
||||
# ...
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -261,7 +304,7 @@ dashes (`-`) are converted to underscores (`_`) in environment variables so
|
|||
- Consul Connect Native is not yet supported.
|
||||
- Consul Connect HTTP and gRPC checks are not yet supported.
|
||||
- Consul ACLs are not yet supported.
|
||||
- Only the Docker, exec, raw exec, and java drivers support network namespaces
|
||||
- Only the Docker, exec, raw_exec, and java drivers support network namespaces
|
||||
and Connect.
|
||||
- Variable interpolation for group services and checks are not yet supported.
|
||||
- Consul Connect and network namespaces are only supported on Linux.
|
||||
|
|
Loading…
Reference in New Issue