From 33deff8760f19920e068fa6256d313f67a443ec7 Mon Sep 17 00:00:00 2001 From: Troy McConaghy Date: Sun, 5 Mar 2017 17:49:00 +0100 Subject: [PATCH] docs: add instructions to deploy MongoDB & BigchainDB on k8s cluster --- .../node-on-kubernetes.rst | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/docs/server/source/cloud-deployment-templates/node-on-kubernetes.rst b/docs/server/source/cloud-deployment-templates/node-on-kubernetes.rst index 00b77bb8..1a8e5deb 100644 --- a/docs/server/source/cloud-deployment-templates/node-on-kubernetes.rst +++ b/docs/server/source/cloud-deployment-templates/node-on-kubernetes.rst @@ -157,3 +157,38 @@ but it should become "Bound" fairly quickly. Capacity: 20Gi Access Modes: RWO No events. + + +Step 5: Deploy MongoDB & BigchainDB +----------------------------------- + +Now you can deploy MongoDB and BigchainDB to your Kubernetes cluster. +Currently, the way we do that is we create a StatefulSet with two +containers: BigchainDB and MongoDB. (In the future, we'll put them +in separate pods, and we'll ensure those pods are in different nodes.) +We expose BigchainDB's port 9984 (the HTTP API port) +and MongoDB's port 27017 using a Kubernetes Service. + +Get the file ``node-mdb-ss.yaml`` from GitHub using: + +.. code:: bash + + $ wget https://raw.githubusercontent.com/bigchaindb/bigchaindb/master/k8s/node-mdb-ss.yaml + +Take a look inside that file to see how it defines the Service +and the StatefulSet. +Note how the MongoDB container uses the ``mongoclaim`` PersistentVolumeClaim +for its ``/data`` diretory (mount path). + +Create the StatefulSet and Service in your cluster using: + +.. code:: bash + + $ kubectl apply -f node-mdb-ss.yaml + +You can check that they're working using: + +.. code:: bash + + $ kubectl get services + $ kubectl get statefulsets