Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capability to advertise different address than the hostname of host. #5

Open
nitinmidha opened this issue Jan 6, 2017 · 1 comment

Comments

@nitinmidha
Copy link

We are trying to implemenent multi data center Couchbase clusters, we will have two or more Couchbase servers running in one data center and two or more running in another data center, providing HA across data center as well as failover capabilites within data center.

Question:
Can we setup a Couchbase Server to advertise a different hostname or IP address than is defined for the host running the Couchbase Server?

Details:
Each data center will have its own Kubernetes Cluster and Couchbase clusters will be deployed on Kubernetes Cluster. As per our current understanding and analysis, Couchbase servers need to reach each individual server in the cluster and across data center. First it reaches to Admin Port and from there it gets the Hostname/IP address to connect on intra node ports.

In a single kubernetes cluster we could have used Stateful Sets and each node could discover each other with internal pod ips, however these pods ips are internal to cluster only and are not routeable outside cluster. So this approach will not work with multiple kubernetes cluster.

To mitigate this issue, we decided to use Demonsets and pinned different Clouchbase Nodes to particular hosts. This way we can port forward the ports from known host to internal pods. This works well for admin port 8091, however when to reach to intra node ports, they use the Hostname/IP of the pod itself which is not routeable. We tried to set the hostname with the name which can be resolved by our dns server, but it seems that Couchbase should be able to listen to that address, only then it will accept it as Hostname.

To mitigate this issue we decided to use use the hostNetwork feature of Kubernetes, which essentially replicates the same network interfaces inside the pod. This worked perfectly as now advertised address is host address and pod is able to listen on that address. But this is not advisable from security standpoint as now pod can influence host network.

Is there a way in which we can listen/bind to internal pod ip (without host networking) and Advertise the host address and then forward the port from host to pod?

@nitinmidha nitinmidha changed the title Capability Advertise Address different than the hostname of host. Capability to advertise different address than the hostname of host. Jan 6, 2017
@arun-gupta
Copy link
Owner

@nitinmidha Checking with the team. Do you mind asking this question on Couchbase Forums?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants