-
Notifications
You must be signed in to change notification settings - Fork 326
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
Support ACL replication #226
Conversation
de7b01c
to
8e27358
Compare
8e27358
to
e60bd68
Compare
NOTE: I will put up a follow-up PR for configuring the anonymous policy to allow cross-dc calls to work. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Luke, awesome work so far! I've reviewed the code and left some comments inline.
Now onto testing it with the Helm chart!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving since my testing with the Helm chart PR were all successful 🎉 There are a couple of comments that are still unresolved, but I don't think they are blocking. Great job!
- Adds flag -acl-replication-token-file for setting the ACL replication token. This token is used by secondary dc's to create ACL policies. If set, this flag turns on ACL replication mode. In this mode we will not bootstrap ACLs since we expect replication to be running. - Modifies various policies and tokens to only be applicable to the local datacenter. These policies should have been only local before. - If running in a secondary DC, append the datacenter name to the policy name. This is required because policies must be globally unique. - Note: we aren't sharing policies between datacenters because each server-acl-init could modify the policy depending on its local config. - Adds agent:read permissions to the replication token which is needed to get the current datacenter.
377040e
to
433e036
Compare
Summary
token. This token is used by secondary dc's to create ACL policies.
This turns on ACL replication mode.
In this mode we will not bootstrap ACLs since we expect replication
to be running.
local datacenter. These policies should have been only local before.
policy name. This is required because policies must be globally
unique.
each server-acl-init could modify the policy depending on
its local config.
Test Description
I took an incremental approach to the tests rather than having all the existing tests take another permutation of replication enabled. I did this because the replication changes are incremental and because I thought adding that permutation to all the tests would make them overly complicated and harder to debug when they failed since multiple consul servers are involved and there's a ton of logs to pick through.
How to test
DC1
wan-fed-acls
Helm branchhelm install
usingprimary-config.yaml
(see below)kubectl get svc consul-mesh-gateway
)primary-dc.yaml
and updatemeshGateway.wanAddress.host
to that IP. Runhelm upgrade
.DC2
kubectl
context to dc2secondary-dc.yaml
and update server.extraConfig.primaryGateways to the primary's mesh gateway IPkubectl apply -f consul-ca-cert.yaml -f consul-ca-key.yaml -f consul-acl-replication-acl-token.yaml
helm install
usingsecondary-dc.yaml
(see below)kubectl get svc consul-mesh-gateway
)secondary-dc.yaml
and updatemeshGateway.wanAddress.host
to that IP. Runhelm upgrade
.primary-dc.yaml
secondary-dc.yaml