-
Notifications
You must be signed in to change notification settings - Fork 73
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
feat: grpc tls connectivity (grpcs) #477
Conversation
Signed-off-by: James Milligan <[email protected]>
Signed-off-by: James Milligan <[email protected]>
Signed-off-by: James Milligan <[email protected]>
Signed-off-by: James Milligan <[email protected]>
Signed-off-by: James Milligan <[email protected]>
Signed-off-by: James Milligan <[email protected]>
…lagd into sync-provider-2
Signed-off-by: James Milligan <[email protected]>
…lagd into sync-provider-2
Co-authored-by: Skye Gill <[email protected]> Signed-off-by: James Milligan <[email protected]>
Signed-off-by: James Milligan <[email protected]>
Signed-off-by: James Milligan <[email protected]>
Signed-off-by: James Milligan <[email protected]>
Signed-off-by: James Milligan <[email protected]>
Signed-off-by: James Milligan <[email protected]>
…lagd into sync-provider-2
Signed-off-by: James Milligan <[email protected]>
Signed-off-by: James Milligan <[email protected]>
Signed-off-by: James Milligan <[email protected]>
Signed-off-by: James Milligan <[email protected]>
Signed-off-by: James Milligan <[email protected]>
Signed-off-by: James Milligan <[email protected]>
Signed-off-by: James Milligan <[email protected]>
Signed-off-by: James Milligan <[email protected]>
Signed-off-by: James Milligan <[email protected]>
Signed-off-by: Kavindu Dodanduwa <[email protected]>
# Conflicts: # cmd/start.go # docs/configuration/configuration.md # docs/configuration/flagd_start.md # pkg/runtime/from_config.go # pkg/runtime/runtime.go # pkg/runtime/runtime_test.go # pkg/sync/file/filepath_sync.go # pkg/sync/grpc/grpc_sync.go # pkg/sync/grpc/grpc_sync_test.go # pkg/sync/http/http_sync.go # pkg/sync/isync.go # pkg/sync/kubernetes/kubernetes_sync.go
Signed-off-by: Kavindu Dodanduwa <[email protected]>
aed4118
to
6577362
Compare
Codecov Report
@@ Coverage Diff @@
## main #477 +/- ##
==========================================
+ Coverage 62.08% 63.39% +1.30%
==========================================
Files 15 15
Lines 1891 1923 +32
==========================================
+ Hits 1174 1219 +45
+ Misses 654 639 -15
- Partials 63 65 +2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Signed-off-by: Kavindu Dodanduwa <[email protected]>
This can be tested using the test server [1] @Kavindu-Dodan created and generating self signed certs. Generate CA cert
Generate Server certificate
Where the file
Once certificates & keys are ready,
[1] https://github.com/Kavindu-Dodan/flagd-grpc-sync-server |
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.
Largely this is working, but I believe it caused a regression in our reconnect which causes flagd to crash when the server connection is lost. This tells me we need a test, e2e or otherwise, for this... I will create a new issue for that. I think the crash itself needs to be resolved in this PR though.
Additionally, grpcs://
is not really a valid scheme. I think it's fine to keep for the uri
style configuration, but I think a boolean for tls
might make more sense for the --sources
style configuration. This more a matter of opinion though... I just feel weird about relying on a non-standard scheme wherever we don't have to.
Edit: I created this issue for testing.
Signed-off-by: Kavindu Dodanduwa <[email protected]>
Good catch. I fixed this and added a unit test to validate this scenario I also have no hard opinion on the |
Confirmed reconnect works now. |
🤖 I have created a release *beep* *boop* --- ## [0.4.2](v0.4.1...v0.4.2) (2023-03-09) ### 🧹 Chore * Add targeted Flag to example config ([#467](#467)) ([6a039ce](6a039ce)) * **deps:** pin dependencies ([#473](#473)) ([679e860](679e860)) * **deps:** update google-github-actions/release-please-action digest to e0b9d18 ([#474](#474)) ([5b85b2a](5b85b2a)) * refactoring and improve coverage for K8s Sync ([#466](#466)) ([6dc441e](6dc441e)) ### 🐛 Bug Fixes * add registry login ([#476](#476)) ([99de755](99de755)) * **deps:** update module golang.org/x/crypto to v0.7.0 ([#472](#472)) ([f53f6c8](f53f6c8)) * **deps:** update module google.golang.org/protobuf to v1.29.0 ([#478](#478)) ([f9adc8e](f9adc8e)) ### ✨ New Features * grpc tls connectivity (grpcs) ([#477](#477)) ([228f430](228f430)) * introduce per-sync configurations ([#448](#448)) ([1d80039](1d80039)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This PR
Introduce TLS connectivity for GRPC sync provider.
TLS can be enabled using schema
grpcs://
. For example,./flagd start --uri grpcs://localhost:8090
Further, a self-sign certificate can be provided for TLS connectivity using configuration source field
certPath
ex:-
./flagd start --sources='[{"uri":"grpcs://localhost:9090","provider":"grpc", "certPath":"<CA_CERT>"}]'
How to test
Start mock server impl - https://github.com/Kavindu-Dodan/flagd-grpc-sync-server & then run flagd with grpc tls mode