How To: use the simple example with the dgraph kubernetes HA deployment?

Moved from GitHub pydgraph/58

Posted by goern:

I have been using the dgraph-ha.yaml to deploy dgraph to kubernetes, now I wanted to use the simple example to talk to that cluster. How do I do that?

martinmr commented :

It won’t run out of the box because it’s hardcoded to connect to localhost:9080 but it should work as long as you change that to host_where_alpha_is_running:grpc_port

From looking at that file, the grpc port should still be 9080.

goern commented :

hmm, it tells me something like

Traceback (most recent call last):
  File "./seed.py", line 37, in <module>
    res = client.query(query, variables=variables)
  File "/home/goern/.local/share/virtualenvs/dgraph-testing-oEC-MPYq/lib/python3.6/site-packages/pydgraph/client.py", line 53, in query
    metadata=metadata, credentials=credentials)
  File "/home/goern/.local/share/virtualenvs/dgraph-testing-oEC-MPYq/lib/python3.6/site-packages/pydgraph/txn.py", line 71, in query
    credentials=credentials)
  File "/home/goern/.local/share/virtualenvs/dgraph-testing-oEC-MPYq/lib/python3.6/site-packages/pydgraph/client_stub.py", line 47, in query
    credentials=credentials)
  File "/home/goern/.local/share/virtualenvs/dgraph-testing-oEC-MPYq/lib/python3.6/site-packages/grpc/_channel.py", line 549, in __call__
    return _end_unary_response_blocking(state, call, False, None)
  File "/home/goern/.local/share/virtualenvs/dgraph-testing-oEC-MPYq/lib/python3.6/site-packages/grpc/_channel.py", line 466, in _end_unary_response_blocking
    raise _Rendezvous(state, None, None, deadline)
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
	status = StatusCode.UNAVAILABLE
	details = "Name resolution failure"
	debug_error_string = "{"created":"@1554231945.648455601","description":"Failed to create subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":2267,"referenced_errors":[{"created":"@1554231945.648453350","description":"Name resolution failure","file":"src/core/ext/filters/client_channel/request_routing.cc","file_line":166,"grpc_status":14}]}"

martinmr commented :

Seems to be an issue with the kubernetes support rather than pydgraph. Can you open a new topic in discuss.dgraph.io? Questions regarding usage, etc. are better there.

goern commented :

It’s there a low level grpc tool i can use for testing the connection? Something that shows me that there is a good grpc handshake?

martinmr commented :

I am not aware of anything like that. I’d check if you can hit the hostname / port over tcp first.