Added grpc info; small style fixes

This commit is contained in:
Charlie Voiselle 2019-10-07 10:05:40 -04:00
parent 4a93081275
commit b777bc98c7
1 changed files with 141 additions and 98 deletions

View File

@ -57,6 +57,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
@ -88,8 +122,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"
@ -106,6 +141,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"
}
@ -115,6 +151,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
@ -139,15 +176,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.
@ -162,7 +201,7 @@ The API service is defined as a task group with a bridge network:
mode = "bridge"
}
...
# ...
}
```
@ -171,7 +210,8 @@ any ports in its network. The service stanza enables Connect:
```hcl
group "api" {
...
# ...
service {
name = "count-api"
@ -182,7 +222,8 @@ any ports in its network. The service stanza enables Connect:
}
}
...
# ...
}
```
@ -198,14 +239,16 @@ forwarded port:
```hcl
group "dashboard" {
network {
mode ="bridge"
mode = "bridge"
port "http" {
static = 9002
to = 9002
}
}
...
# ...
}
```
@ -262,7 +305,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.