How to access the couchdb instance separately Kubernetes OpenWhisk deployment

4/13/2018

I have an Openwhisk cluster deployed in Kubernetes cluster using[1], and for my application, I want to access the internal couchDB database

  1. From within the function

  2. From an external location. I have added the svc list below

I tried several things but i can't seem to access the couchDB database. I changed the couchDB service from ClusterIp to NodePort. Any help with the following will be greatly appreciated. Let's assume the IP of the node is 123.45.67.89

  1. What host:port to use from within a function? I thought it would be 123.45.67.89:30641 but it didn't work,

  2. What host:port to use from the outside (like a curl call)?

Best Regards Pulasthi,

NAME    TYPE    CLUSTER-IP  EXTERNAL-IP PORT(S) AGE
apigateway  NodePort    10.102.34.138   <none> 8080:31305/TCP,9000:31295/TCP    18h
controller  ClusterIP   10.104.235.255  <none>  8080/TCP    18h
couchdb NodePort    10.100.59.247   <none>  5984:30641/TCP  15h
kafka   ClusterIP   10.99.132.46    <none>  9092/TCP    18h
nginx   NodePort    10.104.182.149  <none> 5984:31064/TCP,80:32641/TCP,443:31141/TCP,8443:31389/TCP 10h
zookeeper   ClusterIP   10.102.198.186  <none> 2181/TCP,2888/TCP,3888/TCP   18h

[1] https://github.com/apache/incubator-openwhisk-deploy-kube

-- pulasthi
couchdb
kubernetes
openwhisk

1 Answer

4/13/2018

I was able to resolve this issue, The issue was not with the host:port value. The deployment scripts in [1] create a network policy for CouchDB which restricts access to the CouchDB instance. Once I removed the network policy "couchdb-netpol" the issue was resolved and I could access the CouchDB instance. By default, the deployment in [1] creates the CouchDB service as a ClusterIP you need to change it to NodePort. Once that is done the following host:port allows acccess to the database when you remove or properly configure the "couchdb-netpol" network policy.

[node-ip]:[port_given_in_couchdb_NodePort]

123.45.67.89:30641

[1] https://github.com/apache/incubator-openwhisk-deploy-kube

-- pulasthi
Source: StackOverflow