Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Support ACL replication. #368

Merged
merged 1 commit into from
Mar 16, 2020
Merged

Support ACL replication. #368

merged 1 commit into from
Mar 16, 2020

Conversation

lkysow
Copy link
Member

@lkysow lkysow commented Mar 3, 2020

Support creating an ACL replication token (for primary dcs) via global.acls.createReplicationToken and
referencing a pre-created ACL replication token (for secondary dcs) via global.acls.replicationToken.

One thing to review here is that we're using the existence of global.acls.replicationToken to determine whether we set other config flags that are required for replication. We could have had a separate setting, e.g. global.acls.enableReplication.

@lkysow lkysow marked this pull request as ready for review March 4, 2020 15:53
@lkysow lkysow requested a review from a team March 4, 2020 15:53
@lkysow lkysow changed the base branch from wan-federation-base to wan-federation March 5, 2020 15:51
{{- end }}
{{- if (and .Values.global.acls.replicationToken.secretName .Values.global.acls.replicationToken.secretKey) }}
-enable-acl-replication=true \
-datacenter={{ .Values.global.datacenter }} \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This flag is only needed if we're in replication mode. I put it here to make the helm chart backwards compatible with older versions of consul-k8s that don't have this flag. For single-dc users, this flag isn't needed.

@lkysow lkysow added area/multi-dc Related to running with multiple datacenters enhancement New feature or request labels Mar 5, 2020
Copy link
Contributor

@ishustava ishustava left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Luke, this looks good. A couple of thoughts:

  • The datacenter flag could be retrieved from the server by the ACL bootstrapping job itself. This is optional though and definitely should not block the merge.
  • When it comes to using the replication token to determine if this is the secondary datacenter, I like it. I personally have a bias towards having less configuration options.
  • Right now the bootstrapACLs and the acl.* properties don't interact. I know you've mentioned that this is something you're thinking to change in the future PR, but I thought it's worth noting it here so we don't forget.

templates/server-acl-init-job.yaml Show resolved Hide resolved
@lkysow
Copy link
Member Author

lkysow commented Mar 12, 2020

Updated to remove -datacenter. Another PR for bootstrapACLs deprecation is coming. Companion PR: hashicorp/consul-k8s#226

@lkysow
Copy link
Member Author

lkysow commented Mar 12, 2020

Oh, also changed to use the -acl-replicaton-token-file flag.

@lkysow lkysow requested a review from ishustava March 12, 2020 18:10
Copy link
Contributor

@ishustava ishustava left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I've tested this PR in combination with hashicorp/consul-k8s#226; everything worked great!

templates/server-acl-init-job.yaml Outdated Show resolved Hide resolved
templates/server-acl-init-job.yaml Outdated Show resolved Hide resolved
values.yaml Outdated Show resolved Hide resolved
values.yaml Outdated Show resolved Hide resolved
Suport creating an ACL replication token (for primary dcs) and
referencing a pre-created ACL replication token (for secondary dcs).
@lkysow lkysow merged commit c24f5ff into wan-federation Mar 16, 2020
@lkysow lkysow deleted the wan-fed-acls branch August 31, 2020 21:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/multi-dc Related to running with multiple datacenters enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants