Code Monkey home page Code Monkey logo

couchbase-kubernetes's Introduction

Couchbase on Kubernetes

Start Kubernetes cluster

export KUBERNETES_PROVIDER=aws
./cluster/kube-up.sh

Create Couchbase Service and Expose as LB

Create a Service, Replication Controller with 1 replica, and expose all of this as a Load Balancer

./cluster/kubectl.sh -f couchbase-service.yml

Couchbase Cluster

Implicitly (preferred)

Explicitly

  1. Create Couchbase Replication Controller with 2 replicas:

    ./cluster/kubectl.sh -f couchbase-rc.yml
  2. Get pods in the RC:

    ./kubernetes/cluster/kubectl.sh get po
  3. Get IP address of the two pods:

    ./kubernetes/cluster/kubectl.sh describe <pod-1>
    ./kubernetes/cluster/kubectl.sh describe <pod-2>
  4. Create the cluster and rebalance:

    couchbase-cli rebalance --cluster=<pod-1-ip>:8091 --user Administrator --password password --server-add=<pod-2-ip> --server-add-username=Administrator --server-add-password=password

couchbase-kubernetes's People

Contributors

adityadani avatar arun-gupta avatar rsmitty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

couchbase-kubernetes's Issues

When will k8s detach ebs?

Follow this pv tutorial

When I deleted a pod in rc, chances are will k8s start a new pod on another node. Meanwhile, the ebs volume is still attached to the old node. And there'll be events like 'Failed to mount, ..., VolumeInUse'. But sometimes k8s just start a new pod on the same node, so a little hard to repeat.

Could you please help me with my questions:

  1. Is it an expected behavior that k8s'll auto detach ebs volume when recover a pod on another node?
  2. If not, I should use petset?

Using Statefulset and PVC causing problems when or if Pod restarts

Currently I am using the setup provided in this repo for statefulset with a few exceptions -

  • NOT using configure-node.sh
  • I am using "terminationGracePeriodSeconds" to be 10 instead of 0
  • In couchbase service, I have not added "clusterIP: None" option
  • NOT using "couchbase-ui service".

The issue I am facing is that when or if Pod - "couchbase-0" restarts, its ip will change due to flannel and because of that I am not able to connect to the UI by port-forwarding and the error log says

[ns_server:error,2017-07-20T19:23:34.313Z,nonode@nohost:dist_manager<0.142.0>:dist_manager:init:178]Configured address '10.2.17.3' seems to be invalid. Will refuse to start for safety reasons.

Since we are using persistant volumes the ip must be stored in them and if I go in the pod and manually change the "/opt/couchbase/var/lib/couchbase/ip" file, it kind of resets the settings I had done to the couchbase server and I have to set it up all again.
Also it should detect the two servers i.e. "couchbase-0 and couchbase-1" by itself but it does not do that, I have to manually add the servers and rebalance them.

I have also opened all the ports required - 8091,8092,11207,11209-11211, 11214,11215,18091,18092,21100-21299 but still the problem persists.
Could you tell me what could I do to fix this issue?

Capability to advertise different address than the hostname of host.

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?

connection string using stateful sets

I'm deploying couchbase-server using the statefull sets. I'm unable to connect to the cluster after trying for several different connection strings. What is the correct connection string to use ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.