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 clustering in Kube #837

Closed
sholdee opened this issue Dec 15, 2023 · 3 comments
Closed

StatefulSet clustering in Kube #837

sholdee opened this issue Dec 15, 2023 · 3 comments

Comments

@sholdee
Copy link

sholdee commented Dec 15, 2023

I have been trying to create a Gravity cluster with a 3 replica StatefulSet, but the methods documented for joining the cluster are not possible in this configuration. Various methods I have tried to manually create the cluster have all failed. I was wondering how difficult it would be to have some environment variable, for instance, that could be set that would bootstrap the cluster.

One thing I have done is set the INSTANCE_IDENTIFIER for each pod dynamically to it's DNS name from a headless service (manifest below), which works, and then clustering manually via etcdctl, but I haven't been able to get that part working.

gravity-statefulset.yml: https://pastebin.com/raw/2AgK5xGV

@sholdee sholdee changed the title Stateful clustering in Kube Statefulset clustering in Kube Dec 15, 2023
@sholdee sholdee changed the title Statefulset clustering in Kube StatefulSet clustering in Kube Dec 15, 2023
@BeryJu
Copy link
Owner

BeryJu commented Dec 15, 2023

Most of the node joining mechanics are attempts to make it easier for etcd newcomers and hence probably don't have enough dynamic-ness for K8s. It would probably be easier to use something like https://operatorhub.io/operator/etcd to run etcd, and run 3 gravity instances without etcd

@sholdee
Copy link
Author

sholdee commented Dec 16, 2023

Most of the node joining mechanics are attempts to make it easier for etcd newcomers and hence probably don't have enough dynamic-ness for K8s. It would probably be easier to use something like https://operatorhub.io/operator/etcd to run etcd, and run 3 gravity instances without etcd

You are right; that was the ticket. I have it working now. Thanks!

For anyone else who wants to try and get this going, here are my manifests:

https://pastebin.com/raw/HNzCbP6U

@sholdee sholdee closed this as completed Dec 16, 2023
@bw210343
Copy link

Thank you for sharing. This config worked for me with microk8s. One thing that may be useful for future readers - the cluster only showed 2 replicas (number of replicas - 1) until the statefulset was restarted.

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

3 participants