dgraph-operator-archive icon indicating copy to clipboard operation
dgraph-operator-archive copied to clipboard

k8s: add pod affinity term to dgraph component pods

Open fristonio opened this issue 5 years ago • 2 comments

To test out the anti-affinity specification you can run a trial cluster using kind.

$ kind create cluster

Run dgraph-operator with the configured kubeconfig

$ ./dgraph-operator --kubecfg-path ~/.kube/config 

Create test cluster from the provided test manifests

# To configure dummy persistence volumes for zero and alpha.
$ kubectl apply -f tests/manifests/pv.yaml
$ kubectl apply -f tests/manifests/valid-dgraph-cluster-without-ratel.yaml

Check the stateful set configuration for the configured pod anti affinities.

$ kubectl get statefulsets
NAME                             READY   AGE
xxxx-dgraph-test-cluster-alpha   3/3     29m
xxxx-dgraph-test-cluster-zero    3/3     29m

$ kubectl get statefulsets xxxx-dgraph-test-cluster-zero -o yaml | grep -n7 affinity

This YAML configuration will show the affinities configured for statefulsets pods similar to that of dgraph-ha kubernetes configuration

This change is Reviewable

fristonio avatar Jan 28 '20 21:01 fristonio

Hey Daniel! I have updated the pull request description.

fristonio avatar Jan 28 '20 22:01 fristonio

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Apr 29 '22 07:04 CLAassistant