From 93d06b4e2abceb25cb46eecfb9ba43c6120229ab Mon Sep 17 00:00:00 2001 From: "krish7919 (Krish)" Date: Sat, 4 Mar 2017 20:05:30 +0100 Subject: [PATCH] PVC for MDB in single BDB+MDB StatefulSet --- k8s/node-mdb-ss.yaml | 60 +++++++++++++++++++++----------------------- k8s/node-rdb-ss.yaml | 4 +-- 2 files changed, 30 insertions(+), 34 deletions(-) diff --git a/k8s/node-mdb-ss.yaml b/k8s/node-mdb-ss.yaml index c4a9f2f3..10f22f0f 100644 --- a/k8s/node-mdb-ss.yaml +++ b/k8s/node-mdb-ss.yaml @@ -34,38 +34,43 @@ spec: name: bdb labels: app: bdb - annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "name": "bdb-configure", - "image": "bigchaindb/bigchaindb:latest", - "command": ["bigchaindb", "-y", "configure", "mongodb"], - "volumeMounts": [ - { - "name": "bigchaindb-data", - "mountPath": "/data" - } - ] - } - ]' + #annotations: + #pod.beta.kubernetes.io/init-containers: '[ + # TODO mongodb user and group; id = 999 spec: terminationGracePeriodSeconds: 10 containers: - name: bdb-server image: bigchaindb/bigchaindb:latest args: - - -c - - /data/.bigchaindb - start + env: + - name: BIGCHAINDB_KEYPAIR_PRIVATE + value: 3CjmRhu718gT1Wkba3LfdqX5pfYuBdaMPLd7ENUga5dm + - name: BIGCHAINDB_KEYPAIR_PUBLIC + value: EEWUAhsk94ZUHhVw7qx9oZiXYDAWc9cRz93eMrsTG4kZ + - name: BIGCHAINDB_KEYRING + value: "" + - name: BIGCHAINDB_DATABASE_BACKEND + value: mongodb + - name: BIGCHAINDB_DATABASE_HOST + value: localhost + - name: BIGCHAINDB_DATABASE_PORT + value: "27017" + - name: BIGCHAINDB_SERVER_BIND + value: "0.0.0.0:9984" + - name: BIGCHAINDB_DATABASE_REPLICASET + value: bigchain-rs + - name: BIGCHAINDB_DATABASE_NAME + value: bigchain + - name: BIGCHAINDB_BACKLOG_REASSIGN_DELAY + value: "120" imagePullPolicy: IfNotPresent ports: - containerPort: 9984 hostPort: 9984 name: bdb-port - protocol: TCP - volumeMounts: - - name: bigchaindb-data - mountPath: /data + protocol: TCP resources: limits: cpu: 200m @@ -76,12 +81,6 @@ spec: port: bdb-port initialDelaySeconds: 15 timeoutSeconds: 10 -# readinessProbe: -# httpGet: -# path: / -# port: bdb-port -# initialDelaySeconds: 15 -# timeoutSeconds: 10 - name: mongodb image: mongo:3.4.1 args: @@ -91,7 +90,7 @@ spec: - containerPort: 27017 hostPort: 27017 name: mdb-port - protocol: TCP + protocol: TCP volumeMounts: - name: mdb-data mountPath: /data @@ -108,9 +107,6 @@ spec: timeoutSeconds: 1 restartPolicy: Always volumes: - - name: bigchaindb-data - hostPath: - path: /disk/bigchaindb-data - name: mdb-data - hostPath: - path: /disk/mdb-data + persistentVolumeClaim: + claimName: mongoclaim diff --git a/k8s/node-rdb-ss.yaml b/k8s/node-rdb-ss.yaml index 1ec05868..4a995213 100644 --- a/k8s/node-rdb-ss.yaml +++ b/k8s/node-rdb-ss.yaml @@ -50,10 +50,10 @@ spec: value: "" - name: BIGCHAINDB_DATABASE_BACKEND value: rethinkdb - - name: BIGCHAINDB_DATABASE_PORT - value: "28015" - name: BIGCHAINDB_DATABASE_HOST value: localhost + - name: BIGCHAINDB_DATABASE_PORT + value: "28015" - name: BIGCHAINDB_SERVER_BIND value: "0.0.0.0:9984" imagePullPolicy: IfNotPresent