Skip to content
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

[Spike] Possiblity to deploy flagd as a grpc sync server #411

Closed
3 tasks done
Kavindu-Dodan opened this issue Feb 14, 2023 · 6 comments
Closed
3 tasks done

[Spike] Possiblity to deploy flagd as a grpc sync server #411

Kavindu-Dodan opened this issue Feb 14, 2023 · 6 comments
Assignees

Comments

@Kavindu-Dodan
Copy link
Contributor

Kavindu-Dodan commented Feb 14, 2023

With the introduction of grpc syncs [1] flagd now has the ability to securely (tls encryption) communicate to a grpc sync provider server implementation.

Given that flagd has built-in sync capability on various sources (file, grpc & k8s), it is worth investigating the possibility to build grpc server version of the flagd. This server build can then be used with OFO, where OFO-controlled side cars get connected to flagd server on top of grpc.

Consider the high-level conceptual architecture,

image

Tasks

A POC with following topics

  • Identify reusable components of flagd
  • Local build process (go build flags/ packaging ...)
  • Image build process

[1] - #249

@Kavindu-Dodan Kavindu-Dodan self-assigned this Feb 14, 2023
@beeme1mr beeme1mr moved this from Backlog to In Progress in ☁ Cloud Native Feb 15, 2023
@Kavindu-Dodan
Copy link
Contributor Author

Kavindu-Dodan commented Feb 15, 2023

My initial observations are as below,

  • We can utilize sync providers as they have a clear contract [1]
  • We cannot use the current runtime implementation as it is tightly coupled to the evaluator & notification mechanism
  • Current flag store is also tightly coupled to the eventing mechanism. Hence not possible to reuse if we need an intermediate store
  • Configurations - need a clear definition of what sync sources we should use for the server deployment.
  • Documentation - current documentation is tightly coupled to the evaluation of flags. So if we need a server deployment, we need to put effort to restructure them

With this background, I am leaning toward a dedicated project focusing on server implementation. The simple reason is the limited benefit we will gain by building the server into flagd itself.

cc @beeme1mr @toddbaert @james-milligan @skyerus

[1] - https://github.com/open-feature/flagd/blob/main/pkg/sync/isync.go

@Kavindu-Dodan
Copy link
Contributor Author

Kavindu-Dodan commented Feb 16, 2023

The alternative approach is to avoid internal caching - the store altogether. Then make the "server" focus only on K8s CRDs, resolving permission-related concerns of flagd.

Consider the following,

image

If flagd-server only acts as a "proxy" to K8s resources, making it the only workload that requires elevated K8s API access and combining that with the "no-store" (no parsing of flag definitions), we should have a simple implementation.

@Kavindu-Dodan
Copy link
Contributor Author

Kavindu-Dodan commented Feb 21, 2023

POC is ready. Updated component relationship diagram is given below,

image

@Kavindu-Dodan
Copy link
Contributor Author

Kavindu-Dodan commented Feb 22, 2023

Consider the following options from POC onwards,

flagdServer

  • Single CRD watcher : This is the POC and the candidate for the first version of the implementation
  • Multi-CRD watcher - this can be done as a follow-up on top of the existing implementation
  • On-demand CRD watcher - In my view this is a complex task and should be an extended goal if there is a demand for this use case.

@james-milligan
Copy link
Contributor

I have concerns regarding the Single and Multi implementations, in both of these examples the flagd server would need to be aware of all crds on startup, and would need to watch each of them permanently.

In the on-demand implementation a developer could introduce a new CR whilst the server instance is running and sync to it without bouncing the server. This also introduces the opportunity to drop a sync when there are no longer any subscribers for it, reducing load on the api.

@Kavindu-Dodan
Copy link
Contributor Author

I have concerns regarding the Single and Multi implementations, in both of these examples the flagd server would need to be aware of all crds on startup, and would need to watch each of them permanently.

In the on-demand implementation a developer could introduce a new CR whilst the server instance is running and sync to it without bouncing the server. This also introduces the opportunity to drop a sync when there are no longer any subscribers for it, reducing load on the api.

💯 correct

If we have a requirement to support the dynamic use case, then we should aim for the third solution.

@beeme1mr beeme1mr moved this from In Progress to Needs review in ☁ Cloud Native Feb 24, 2023
@github-project-automation github-project-automation bot moved this from Needs review to Done in ☁ Cloud Native Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants