-
Notifications
You must be signed in to change notification settings - Fork 323
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
Add create-federation-secret command #253
Conversation
2cbae31
to
2af6e34
Compare
2af6e34
to
f06661f
Compare
f06661f
to
c9658b9
Compare
14e269d
to
756520f
Compare
756520f
to
b9dc784
Compare
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.
Nice work! Super clear comments everywhere and great test coverage! I left some comments as I read through the code, but haven't tested it yet.
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, this looks great to me! Thanks for making the changes. I'm going to approve this because I don't think pulling out the command flags should be a blocker for this PR, but definitely let me know if you want me to re-review in case you get that working.
I have done my testing on the helm branch you've mentioned like so:
- Tested on a single cluster with ACLs, TLS with and without auto-encrypt, and gossip encryption enabled. I have then just compared the values in the federation secret are what I expect. I also did one additional test with custom CAs.
- I did one end-to-end test with two clusters (one on AKS, one on GKE) with ACLs, TLS with auto-encrypt, and gossip encryption all enabled. I've created static-server in dc2 and static-client in dc1. Everything worked beautifully! The user flow was so easy I didn't even realize what I had accomplished in just 20-30 minutes.
🎉 🎉 🎉
This command will be run as a Kubernetes Job via a Helm hook. It creates a Kubernetes secret that contains data needed by secondary datacenters to federate with the primary. To set up a secondary dc, users will export this secret from their primary and import it into secondaries. They will then reference the secret in their Helm config for secondaries. The command works with ACLs enabled/disabled and with gossip encryption enabled/disabled. The command only works when TLS is enabled because federation requires TLS be enabled.
fac59df
to
3e5853c
Compare
This command will be run as a Kubernetes Job via a Helm hook. It creates
a Kubernetes secret that contains data needed by secondary datacenters
to federate with the primary. To set up a secondary dc, users will
export this secret from their primary and import it into secondaries.
They will then reference the secret in their Helm config for
secondaries.
The command works with ACLs enabled/disabled and with gossip encryption
enabled/disabled. The command only works when TLS is enabled because
federation requires TLS be enabled.
Flags worth noting:
-export-replication-token
will be set to true if ACLs are enabled. Helm chart will ensure this job can't run unlesscreateReplicationToken: true
is set (when acls are enabled) to ensure this secret exists-gossip-key-file
will be set if gossip encryption is enabled (mounted in via helm chart)CA differences with autoencrypt:
-ca-file
and-server-ca-cert-file
flags. When auto-encrypt is not enabled, these will point to the same files but when auto-encrypt is enabled, they'll point to different files with the-ca-file
flag pointing to the file created by the auto-encrypt init container.Design requirements: Needs to be able to tolerate Consul clients not running yet, mesh gateways not created yet and replication secret not created yet because these will all be happening concurrently.
Refactoring:
common
package.test_util
file incommon
.Tests cover:
Testing
Locally
You can actually run this command locally pretty easily:
tls.crt
In Cluster