0

Could someone help to connect to rethinkdb in openshift using rethinkdbdash

I have deployed rethinkdb in openshift & create 3 clusterIP services
1.8080 - admin
2.29015 - intracluster communicated
3.28015 - client connection

I have created a route which targets client connection clusterIP service(port 28015)
I tried to use that from client side as below

 const r = require('rethinkdbdash')({  
  cursor: true,  
  silent: true,  
  host: rethink-client.test.exchange.com,    
  port: 80  
 )}

I am getting below error

     data: Timeout during operation
(node:5739) UnhandledPromiseRejectionWarning: Error: Cannot wrap non-Error object

client Route

Raja
  • 79
  • 1
  • 10

1 Answers1

0

You should use NodePort or LoadBalancer type Services to expose your DB connection to external instead of Route. Because Route does not support TCP protocol. Refer here for supported protocols. For instance of mysql db, further details are provided in Using a NodePort to Get Traffic into the Cluster.

apiVersion: v1
kind: Service
metadata:
  name: mysql
  labels:
    name: mysql
spec:
  type: NodePort
  ports:
    - port: 3306
      nodePort: 30036
      name: http
  selector:
    name: mysql
Daein Park
  • 4,393
  • 2
  • 12
  • 21
  • In that case I would have to access : but if pod is redeployed for some reason ,the Node IP will change ,what should I do in this case?? Also I have created TCP Mapping service `apiVersion: getambassador.io/v2 kind: TCPMapping metadata: annotations: ---removed--- creationTimestamp: '2020-11-28T17:27:27Z' generation: 1 labels: app: rethinkdb name: rethinkdb-client namespace: testnas spec: host: rethink-client.test.exchange.com port: 28015 service: 'tcp://rethinkdb:28015' weight: 100 ` – Raja Nov 28 '20 at 17:42
  • TCP mapping didn't work, I am unable to reach rethinkdb port 28015 using "rethink-client.test.exchange.com:28015" ,its getting times out – Raja Nov 29 '20 at 12:24