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?
Yes
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
iluminae
(Kenan Kessler)
April 12, 2021, 12:53pm
2
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.
MichelDiz
(Michel Diz)
April 12, 2021, 1:35pm
3
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"
Head("Limit options").
Flag("uid-lease",
`The maximum number of UIDs that can be leased by namespace (except default namespace)
in an interval specified by refill-interval. Set it to 0 to remove limiting.`).
Flag("refill-interval",
"The interval after which the tokens for UID lease are replenished.").
Flag("disable-admin-http",
"Turn on/off the administrative endpoints exposed over Zero's HTTP port.").
String())
flag.String("raft", raftDefaults, z.NewSuperFlagHelp(raftDefaults).
Head("Raft options").
Flag("idx",
"Provides an optional Raft ID that this Alpha would use to join Raft groups.").
Flag("learner",
`Make this Zero a "learner" node. In learner mode, this Zero will not participate `+
"in Raft elections. This can be used to achieve a read-only replica.").
String())
flag.String("audit", worker.AuditDefaults, z.NewSuperFlagHelp(worker.AuditDefaults).
Head("Audit options").