Dgraph zero live loader issue

dgraph-alpha            ClusterIP   None             <none>        7080/TCP            14d
dgraph-alpha-public     ClusterIP   <none>        8080/TCP,9080/TCP   14d
dgraph-ratel-public     ClusterIP    <none>        8000/TCP            14d
dgraph-zero             ClusterIP   None             <none>        5080/TCP            14d
dgraph-zero-public      ClusterIP    <none>        5080/TCP,6080/TCP   14d

have HA setup for dgraph want to access the live loader used the following command :-:

dgraph live --alpha serverip:9080 -f sample.rdf --zero serverip:5080

getting the following error:-

Running transaction with dgraph endpoint: serverip:9080
2023/02/17 17:41:56 context deadline exceeded
Unable to connect to zero, Is it running at serverip:5080?
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:830
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:914
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:864

You saw this line in the error message?

Unable to connect to zero, Is it running at serverip:5080

That’s the grpc port for the zero, but you can try to connect with curl…

curl serverip:5080

If it responds with an issue about the HTTP version, then there’s a route to that IP. If it responds with “Failed to connect…” then you need to solve the network issue.

This is k8s. If serverip is an address, it’s wrong. Addresses in K8s are created with svc automatically. If you use our example YAML for K8s this will be solved. If serverip is indeed an IP. We may have a problem there. Depending on the context, a pod cannot see the Cluster IP, only its pod context. Ideally, never use fixed names or IP addresses, as this is an orchestrator. Everything is dynamic, mainly name resolution by K8s internal DNS.