mirror of https://github.com/status-im/consul.git
added additonal example for failover within DC and unique namespace
This commit is contained in:
parent
b844d68c4b
commit
205d687d07
|
@ -116,9 +116,9 @@ spec:
|
|||
|
||||
</CodeTabs>
|
||||
|
||||
### Datacenter failover
|
||||
### Failover
|
||||
|
||||
Enable failover for subset 'v2' to 'dc2', and all other subsets to dc3 or dc4:
|
||||
Enable failover for subset `v2` to `dc2`, and all other subsets to `dc3` or `dc4`:
|
||||
|
||||
<CodeTabs tabs={[ "HCL", "Kubernetes YAML", "JSON" ]}>
|
||||
|
||||
|
@ -194,22 +194,70 @@ metadata:
|
|||
name: product-api
|
||||
namespace: primary
|
||||
spec:
|
||||
connectTimeout: 0
|
||||
connectTimeout: 0s
|
||||
failover:
|
||||
namespace: 'secondary'
|
||||
'*':
|
||||
datacenters: ['dc2']
|
||||
datacenters: ['dc2']
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"Kind": "service-resolver",
|
||||
"Name": "product-api",
|
||||
"Namespace": "primary"
|
||||
"Namespace": "primary",
|
||||
"ConnectTimeout": "0s",
|
||||
"Failover": {
|
||||
"*": {
|
||||
"Datacenters": ["dc2"]
|
||||
"Datacenters": ["dc2"],
|
||||
"Namespace": "secondary"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</CodeTabs>
|
||||
|
||||
<EnterpriseAlert product="consul">
|
||||
Failover within a datacenter and a different namespace.
|
||||
</EnterpriseAlert>
|
||||
|
||||
<CodeTabs tabs={[ "HCL", "Kubernetes YAML", "JSON" ]}>
|
||||
|
||||
```hcl
|
||||
Kind = "service-resolver"
|
||||
Name = "product-api"
|
||||
Namespace = "primary"
|
||||
ConnectTimeout = "0s"
|
||||
Failover = {
|
||||
"*" = {
|
||||
Service = "product-api-backup"
|
||||
Namespace = "secondary"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```yaml
|
||||
apiVersion: consul.hashicorp.com/v1alpha1
|
||||
kind: ServiceResolver
|
||||
metadata:
|
||||
name: product-api
|
||||
namespace: primary
|
||||
spec:
|
||||
connectTimeout: 0s
|
||||
failover:
|
||||
service: 'product-api-backup'
|
||||
namespace: 'secondary'
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"Kind": "service-resolver",
|
||||
"Name": "product-api",
|
||||
"Namespace": "primary",
|
||||
"ConnectTimeout": "0s",
|
||||
"Failover": {
|
||||
"*": {
|
||||
"Service": "product-api-backup",
|
||||
"Namespace": "secondary"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue