From 967093f425cd70427fc92fbefb5537a850f4600b Mon Sep 17 00:00:00 2001 From: Karl Cardenas Date: Mon, 10 Jan 2022 10:45:54 -0700 Subject: [PATCH] added another example for DC and namespace failover --- .../config-entries/service-resolver.mdx | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/website/content/docs/connect/config-entries/service-resolver.mdx b/website/content/docs/connect/config-entries/service-resolver.mdx index 6afe1265e..5a060335f 100644 --- a/website/content/docs/connect/config-entries/service-resolver.mdx +++ b/website/content/docs/connect/config-entries/service-resolver.mdx @@ -168,6 +168,57 @@ spec: + + {' '} + Failover to another datacenter and namespace + + + + +```hcl +Kind = "service-resolver" +Name = "product-api" +Namespace = "primary" +ConnectTimeout = "0s" +Failover = { + "*" = { + Datacenters = ["dc2"] + Namespace = "secodary" + } +} +``` + +```yaml +apiVersion: consul.hashicorp.com/v1alpha1 +kind: ServiceResolver +metadata: + name: product-api + namespace: primary +spec: + connectTimeout: 0 + failover: + namespace: 'secondary' + '*': + datacenters: ['dc2'] +``` + +```json +{ + "Kind": "service-resolver", + "Name": "product-api", + "Namespace": "primary" + "ConnectTimeout": "0s", + "Failover": { + "*": { + "Datacenters": ["dc2"] + "Namespace": "secondary" + } + } +} +``` + + + ### Consistent load balancing Apply consistent load balancing for requests based on `x-user-id` header: