Dgraph zero live loader issue

dgraph-alpha            ClusterIP   None             <none>        7080/TCP            14d
dgraph-alpha-public     ClusterIP   172.30.197.173   <none>        8080/TCP,9080/TCP   14d
dgraph-ratel-public     ClusterIP   172.30.64.183    <none>        8000/TCP            14d
dgraph-zero             ClusterIP   None             <none>        5080/TCP            14d
dgraph-zero-public      ClusterIP   172.30.93.187    <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?
github.com/dgraph-io/dgraph/x.Checkf
        /home/runner/work/dgraph/dgraph/x/error.go:51
github.com/dgraph-io/dgraph/dgraph/cmd/live.setup
        /home/runner/work/dgraph/dgraph/dgraph/cmd/live/run.go:634
github.com/dgraph-io/dgraph/dgraph/cmd/live.run
        /home/runner/work/dgraph/dgraph/dgraph/cmd/live/run.go:788
github.com/dgraph-io/dgraph/dgraph/cmd/live.init.0.func1
        /home/runner/work/dgraph/dgraph/dgraph/cmd/live/run.go:136
github.com/spf13/cobra.(*Command).execute
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:830
github.com/spf13/cobra.(*Command).ExecuteC
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:914
github.com/spf13/cobra.(*Command).Execute
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:864
github.com/dgraph-io/dgraph/dgraph/cmd.Execute
        /home/runner/work/dgraph/dgraph/dgraph/cmd/root.go:78
main.main
        /home/runner/work/dgraph/dgraph/dgraph/main.go:99
runtime.main
        /opt/hostedtoolcache/go/1.18.5/x64/src/runtime/proc.go:250
runtime.goexit
        /opt/hostedtoolcache/go/1.18.5/x64/src/runtime/asm_amd64.s:1571

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.