Question on cluster ports


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                        |    |
|             |                              |    |

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.




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:

Is there a way around this?