3

I have set up an Arango instance on Kubernetes nodes, which were installed on a VM, as mentioned in the ArangoDB docs ArangoDB on Kubernetes. Keep in mind, I skipped the ArangoLocalStorage and ArangoDeploymentReplication step. I can see 3 pods each of agent, coordinators and dbservers in get pods.

The arango-cluster-ea service, however, shows the external IP as pending. I can use the master node's IP address and the service port to access the Web UI, connect to the DB and make changes. But I am not able to access either the Arango shell, nor am I able to use my Python code to connect to the DB. I am using the Master Node IP and the service port shown in arango-cluster-ea in services to try to make the Python code connect to DB. Similarly, for arangosh, I am trying the code:

kubectl exec -it *arango-cluster-crdn-pod-name* -- arangosh --service.endpoint tcp://masternodeIP:8529

In case of Python, since the Connection class call is in a try block, it goes to except block. In case of Arangosh, it opens the Arango shell with the error:

Cannot connect to tcp://masternodeIP:port

thus not connecting to the DB.

Any leads about this would be appreciated.

Wytrzymały Wiktor
  • 11,492
  • 5
  • 29
  • 37
Arghya Dutta
  • 105
  • 1
  • 8
  • Hi, I've tried to replicate your setup and I've encountered the same error. I wasn't able to connect to the db with `arangosh` from the `Pod` and with python code from another host. I'd reckon you could also ask on the `kube-arangodb` github page: https://github.com/arangodb/kube-arangodb/issues . – Dawid Kruk Jun 08 '21 at 15:17
  • 1
    Hi, I have created an issue on ```kube-arangodb``` github right now. Would want your opinion on one thing since I directly created the arangodb environment on the pod instead of doing it directly on the VM - would my issue be partially resolved if I simply install the DB on the master node instead of doing the kubectl apply installation process? I understand that the process would not be containerized in that case. – Arghya Dutta Jun 08 '21 at 17:19
  • Apologies but I cannot help you with this question as I do not know arangodb. I've tried to reproduce the setup of yours to see if there is any issue on the Kubernetes side. I'd think that it could help as a workaround for a time being (provision it directly) but I cannot guarantee it in any way. – Dawid Kruk Jun 10 '21 at 10:45

1 Answers1

3

Posting this community wiki answer to point to the github issue that this issue/question was resolved.

Feel free to edit/expand.


Link to github:

Here's how my issue got resolved:

To connect to arangosh, what worked for me was to use ssl before using the localhost:8529 ip-port combination in the server.endpoint. Here's the command that worked:

  • kubectl exec -it _arango_cluster_crdn_podname_ -- arangosh --server.endpoint ssl://localhost:8529

For web browser, since my external access was based on NodePort type, I put in the master node's IP and the 30000-level port number that was generated (in my case, it was 31200).

For Python, in case of PyArango's Connection class, it worked when I used the arango-cluster-ea service. I put in the following line in the connection call:

  • conn = Connection(arangoURL='https://arango-cluster-ea:8529', verify= False, username = 'root', password = 'XXXXX') The verify=False flag is important to ignore the SSL validity, else it will throw an error again.

Hopefully this solves somebody else's issue, if they face the similar issue.


I've tested following solution and I've managed to successfully connect to the database via:

  • arangosh from localhost:
Connected to ArangoDB 'http+ssl://localhost:8529, version: 3.7.12 [SINGLE, server], database: '_system', username: 'root'
  • Python code
from pyArango.connection import *
conn = Connection(arangoURL='https://ABCD:8529', username="root", password="password",verify= False )
db = conn.createDatabase(name="school")

Additional resources:

Dawid Kruk
  • 8,982
  • 2
  • 22
  • 45