Question on cluster ports

#1

The operator seems to create a couple of different cluster ports for the server cluster cb and cb-srv

Can anyone tell us what the difference is between these two ports? If we build an API microservice that runs in the same k8s cluster which would it use – and what is the other one for?

$ minikube service list
|-------------|------------------------------|--------------------------------|
|  NAMESPACE  |             NAME             |              URL               |
|-------------|------------------------------|--------------------------------|
| default     | cb                           | No node port                   |
| default     | cb-srv                       | No node port                   |
| default     | cb-ui                        | http://172.16.129.128:31562    |
|             |                              | http://172.16.129.128:30703    |
#2

Fairly simple! The plain cb service references all nodes in the cluster and is used to establish stable DNS names for the nodes. The cb-srv service only references the nodes running the data service and creates an SRV record for it. This can be used as a stable couchbase://cb-srv.default.svc in your client connection string which does service discovery and client bootstrap via the data service.

Magic!

#3

Simon,

Is there a way to properly reach the cluster from outside k8s using just a NodePort? We’re doing development and have a k8s 3-node cluster spun up. We’re trying to write some integration tests against it outside of the cluster using the Golang SDK. We exposed the cb using a NodePort and can reach the endpoint from outside the cluster, but when we use the SDK, we get operation has timed out similar to this SO article: https://stackoverflow.com/q/49197790

Is there a way around this?