-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consul Connect configuration in multi datacenter setup with Vault provider #6819
Comments
Hi there. Have you gotten your current configuration working? We definitely do not recommend setting the secondary DC For future reference, Issues on GitHub for Consul are intended to be related to bugs or feature requests, so we recommend using our other community resources instead of asking here.
|
Thanks for the reply @crhino. I guess a blog post on a multi datacenter setup with Connect enabled while using Vault provider can be useful here.
But should they share the same CA? Connect is something new to us so we were wondering how Mesh gateway and proxy is working in multi datacenter setup |
They do not need to share the same CA. I did some digging on this to understand myself and came up with the insight that, in a secondary datacenter, the I agree that we can improve the documentation and guidance around setting up this type of cluster, and I'll take an action to see what can be done about that. Let me know if you have any more questions! |
So the Vault token on the secondary datacenter should have the following policies right? path "secondary-dc-root-pki/*" {
capabilities = ["read", "list"]
}
path "secondary-dc-root-pki/root/sign-intermediate" {
capabilities = ["sudo", "create", "update"]
}
path "primary-dc-connect-pki/*" {
capabilities = ["read", "list"]
}
path "primary-dc-connect-pki/root/sign-intermediate" {
capabilities = ["sudo", "create", "update"]
}
path "secondary-dc-connect-pki/*" {
capabilities = ["create", "read", "update", "list", "sudo"]
} If we get the Vault policies documented, that could be very helpful because in most enterprise setups it need to be well defined. |
Just a note - if multiple Consul datacenters share ANY pki mounts under Vault, they will compete and overwrite the CA key+cert, eventually resulting in
hashicorp/vault#2685 This makes it extremely painful if you want to scale to N secondary datacenters with a single primary datacenter, as you end up having to have N pki mounts - when you are working with about 30+ datacenters it gets ridiculous. I believe there may be a race condition of some sort (or it's just broken; after the amount of hours I've invested in troubleshooting Consul problems I don't care to track down those specifics anymore, only to have the issue closed by someone like @jefferai without looking very far into it). Incidentally, there seems to also be another issue that seems to cause hashicorp/vault#2685 which is that when using the Vault provider for Terraform, you can set Lastly, make sure you are including both the Consul pki root AND intermediate certs in the SAME file under either Fuck, this was frustrating to sort out, and Consul/Envoy do very little to help with their logs. |
My last major complaint, is that there is absolutely no way to have a deterministic cluster id, so it's literally impossible to bootstrap a cluster with a static:
or the equivalent with Vault and Consul Connect (specifically the PKI) is easily one of the most frustrating tools I've ever worked with - it's right up there with Asterisk and complex multiple layer NAT traversal. |
Comcast has experienced the same issue as outlined above. Impact: New service instances cannot join the mesh when the intermediate is corrupt. This causes significant issues for services scaling up to handle more customer demand. The following screenshot demonstrates the error in production: |
@dnephin NOTE: Your doc PR #11143 should address this issue also. cc @quinndiggity |
Thanks for the note! Looking at some of the other discussion in this issue, my proposal and findings in #11159 may also be of interest. |
Yes, for this issue #11159 has value. |
Currently I am working on setting up Consul clusters in multi datacenter setup with Connect enabled while using Vault provider.
Consul 1.6.2
We have a
root-pki
and we setup two PKI for connectconsul-connect-west-pki
andconsul-connect-east-pki
.Connect configuration on the primary datacenter:
Connect configuration on the secondary datacenter:
Is this the right approach? Or should I set
root_pki_path
for the secondary datacenter to point to the primary PKI? like:The text was updated successfully, but these errors were encountered: