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

StatefulSet vs Deployment #44

Open
eric-pierre opened this issue Apr 9, 2024 · 5 comments
Open

StatefulSet vs Deployment #44

eric-pierre opened this issue Apr 9, 2024 · 5 comments

Comments

@eric-pierre
Copy link

Hi!

I will confess being completly new to CubeJs, which is why my question may sound profoundly ignorant, but I was wondering whether the worker and router pods could be scheduled via a Deployment instead of a StatefulSet? What would be the consequence?

Thanks for your kind help!

@lvauvillier
Copy link
Collaborator

Hi @eric-pierre,

We require a StatefulSet because we deploy a headless service, allowing worker instances to receive stable names to communicate each other and declared to the router.

More info here:
https://kubernetes.io/docs/concepts/services-networking/service/#headless-services

Router registration:
https://github.com/gadsme/charts/blob/main/charts/cubestore/templates/router/statefulset.yaml#L83

Worker registration:
https://github.com/gadsme/charts/blob/main/charts/cubestore/templates/workers/statefulset.yaml#L70

@eric-pierre
Copy link
Author

eric-pierre commented Apr 10, 2024 via email

@lvauvillier
Copy link
Collaborator

lvauvillier commented Apr 10, 2024

The CUBESTORE_WORKERS environment variable is required to communicate with all declared workers. Therefore, we require a list of DNS names that provides direct access to all worker pods.

We opt for a headless service in this scenario because we wish to avoid using a load balancer. The goal is to enable communication between individual pods while ensuring stable network identities and DNS-based service discovery.

@eric-pierre
Copy link
Author

eric-pierre commented Apr 10, 2024 via email

@lvauvillier
Copy link
Collaborator

lvauvillier commented Apr 10, 2024

I updated my previous comment. When using a load balancer, the CUBESTORE_WORKERS value becomes a single entry point. However, CubeStore requires direct access to each individual pod.

You can look at the CUBESTORE_WORKERS value in the docker-compose example here:
https://cube.dev/docs/product/caching/running-in-production

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants