mirror of https://github.com/status-im/consul.git
Merge pull request #6141 from hashicorp/hcl-multi-service-docs
Document multiple services config in hcl
This commit is contained in:
commit
42dae36923
|
@ -235,7 +235,7 @@ Multiple services definitions can be provided at once using the plural
|
|||
{
|
||||
"args": ["/bin/check_redis", "-p", "6000"],
|
||||
"interval": "5s",
|
||||
"ttl": "20s"
|
||||
"timeout": "20s"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -252,7 +252,7 @@ Multiple services definitions can be provided at once using the plural
|
|||
{
|
||||
"args": ["/bin/check_redis", "-p", "7000"],
|
||||
"interval": "30s",
|
||||
"ttl": "60s"
|
||||
"timeout": "60s"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -261,6 +261,44 @@ Multiple services definitions can be provided at once using the plural
|
|||
}
|
||||
```
|
||||
|
||||
In HCL you can specify the plural `services` key (although not `service`) multiple times:
|
||||
|
||||
```hcl
|
||||
services {
|
||||
id = "red0"
|
||||
name = "redis"
|
||||
tags = [
|
||||
"primary"
|
||||
]
|
||||
address = ""
|
||||
port = 6000
|
||||
checks = [
|
||||
{
|
||||
args = ["/bin/check_redis", "-p", "6000"]
|
||||
interval = "5s"
|
||||
timeout = "20s"
|
||||
}
|
||||
]
|
||||
}
|
||||
services {
|
||||
id = "red1"
|
||||
name = "redis"
|
||||
tags = [
|
||||
"delayed",
|
||||
"secondary"
|
||||
]
|
||||
address = ""
|
||||
port = 7000
|
||||
checks = [
|
||||
{
|
||||
args = ["/bin/check_redis", "-p", "7000"]
|
||||
interval = "30s"
|
||||
timeout = "60s"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Service and Tag Names with DNS
|
||||
|
||||
Consul exposes service definitions and tags over the [DNS](/docs/agent/dns.html)
|
||||
|
|
Loading…
Reference in New Issue