Kubernetes HA Config is broken `unknown flag: --raft`

Report a Dgraph Bug

Kubernetes HA Config is broken with error at zero: unknown flag: --raft

What version of Dgraph are you using?

Dgraph Version

dgraph:latest docker image

Have you tried reproducing the issue with the latest release?


What is the hardware spec (RAM, OS)?

GKE 1.18 and Mac OS (Minikube)

Steps to reproduce the issue (command/config used to run Dgraph).

Fast reproduction using minikube cluster:

minikube start

Follow the guide at Dgraph website

Create HA cluster

kubectl create --filename https://raw.githubusercontent.com/dgraph-io/dgraph/master/contrib/config/kubernetes/dgraph-ha/dgraph-ha.yaml

Check success

# kubectl get all 
NAME                                READY   STATUS             RESTARTS   AGE
pod/dgraph-alpha-0                  0/1     Running            7          13m
pod/dgraph-ratel-56bcdd668d-gs7f7   1/1     Running            0          13m
pod/dgraph-zero-0                   0/1     CrashLoopBackOff   7          13m

Now check what’s happened with dgraph-zero-0

kubectl logs pod/dgraph-zero-0

The result is:

++ hostname
+ [[ dgraph-zero-0 =~ -([0-9]+)$ ]]
+ ordinal=0
+ idx=1
+ [[ 0 -eq 0 ]]
++ hostname -f
+ exec dgraph zero --my=dgraph-zero-0.dgraph-zero.default.svc.cluster.local:5080 --raft=idx=1 --replicas 3
[Decoder]: Using assembly version of decoder
Page Size: 4096
Error: unknown flag: --raft

It seems something in latest release broke --raft flag

Latest appears to have the same digest as dgraph:v20.11.3 - and --raft is a flag only valid on v21.03.0.

I would suggest never using floating tags for this reason. Specify which version you actually want to run.

Raft config is valid to the latest, and only, no old version has it. @fletcherist please check if your k8s has pulled the latest or it is using local latest. This YAML uses imagePullPolicy: IfNotPresent. Check the version via exec to be sure.

Here an example of a Raft config

--raft "idx=1; group=1; snapshot-after-entries=100; snapshot-after-duration=15s"