Deploy dgraph containers (alpha and zero) within one pod

What I want to do

Deploy Dgraph in to k8s cluster alongside with application that will store data into it. I want to reduce the footprint of the solution as much as possible and thought to myself if dgraph microservices can be deployed in pod. For example pod dgraph-1 contains two containers dgraph-alpha-1 and dgraph-zero-1.
Is it possible? Someone tried? Can it even work ?

Hi @Valera_Bronshtein,

Possibly :slight_smile:

If you do try, you might consider the dgraph/standalone image. It runs both an alpha and zero in the container.

Thanks for your response.
I do want to use dgraph in cluster mode, can I use the image you suggested in the 3 nodes HA mode?

Have you gone through this: https://dgraph.io/docs/installation/kubernetes/ ?

Thank you for considering Dgraph. While it is technically possible to do so, it is generally not recommended as it can lead to scalability and maintainability issues in the long run. It is better to have separate pods for each application, so they can be managed independently and scaled as needed. I hope this helps clarify the best practice for deploying applications on Kubernetes.

You could use the dgraph/standalone image which contains a Zero and an Alpha instance running in the same container. However, clustering is not possible with this approach. Perhaps, if you create a standalone script that somehow manages the entry and exit of Dgraph nodes as you scale your cluster, it could work. But, it seems like a complex solution to maintain. I would not recommend it.