summaryrefslogtreecommitdiffstats
path: root/deployments
diff options
context:
space:
mode:
authorKiran Kamineni <kiran.k.kamineni@intel.com>2018-12-10 13:34:16 -0800
committerKiran Kamineni <kiran.k.kamineni@intel.com>2018-12-14 14:26:26 -0800
commitd203ccf9174e450b6f5a6a9aabea95b73c9973ff (patch)
tree702034eafbd28b47f33023607ee213cf92519a99 /deployments
parentaa56022e0fba3c358e46e8671d9a0cd36094ebaa (diff)
Migrating from consul to mongodb for backend
Migrating to mongodb from consul. The main reason being the value size limitation of 512kb in consul. See https://jira.onap.org/browse/MULTICLOUD-426 for details. This requires a little bit of hierarchy management and data management. We are no longer converting structs to json encoded strings. The underlying db supports structs without any modifications. Also, since Mongo has the concept of collections, each submodule can use its own collection for storage as needed. Definition uses a collection called rbdef right now. P10: Enabling unit tests for mongo.go. This requires the usage of aliased functions. P11: Expanded unit tests for all functions in mongo.go P12: Refactored parameter validation. Removed TestHealthCheck as we are not mocking any of the db commands right now Checking return value of read with an expected value P13: Adding back consul support. Fixing functional test Full consul implementation check and modifications is being tracked by MULTICLOUD-427 P15: Fix ReadAll unit test and corresponding code ReadAll now returns error when no objects are found Issue-ID: MULTICLOUD-426 Change-Id: I42d239b324025fc4ef4e561790aceeff794001ef Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
Diffstat (limited to 'deployments')
-rw-r--r--deployments/docker-compose.yml15
-rwxr-xr-xdeployments/start.sh8
2 files changed, 9 insertions, 14 deletions
diff --git a/deployments/docker-compose.yml b/deployments/docker-compose.yml
index 73d5651c..a72bd096 100644
--- a/deployments/docker-compose.yml
+++ b/deployments/docker-compose.yml
@@ -28,33 +28,28 @@ services:
environment:
- CSAR_DIR=/opt/csar
- KUBE_CONFIG_DIR=/opt/kubeconfig
- - DATABASE_TYPE=consul
+ - DATABASE_TYPE=mongo
- DATABASE_IP=172.19.0.2
- PLUGINS_DIR=/opt/multicloud/k8s
- HTTP_PROXY=$HTTP_PROXY
- HTTPS_PROXY=$HTTPS_PROXY
- NO_PROXY=$NO_PROXY,172.19.0.2
depends_on:
- - consul
+ - mongo
links:
- - consul
+ - mongo
volumes:
- /opt/csar:/opt/csar
- /opt/kubeconfig:/opt/kubeconfig
- consul:
- image: consul
+ mongo:
+ image: mongo
networks:
multicloud_net:
ipv4_address: 172.19.0.2
environment:
- CONSUL_CLIENT_INTERFACE: 'eth0'
- CONSUL_BIND_INTERFACE: 'eth0'
HTTP_PROXY: $HTTP_PROXY
HTTPS_PROXY: $HTTPS_PROXY
NO_PROXY: $NO_PROXY
- command: ["agent", "-server", "-bootstrap-expect=1"]
- volumes:
- - /opt/consul/config:/consul/config
networks:
multicloud_net:
diff --git a/deployments/start.sh b/deployments/start.sh
index da2eacee..d1b9f68a 100755
--- a/deployments/start.sh
+++ b/deployments/start.sh
@@ -19,13 +19,13 @@ export IMAGE_NAME="nexus3.onap.org:10003/onap/multicloud/k8s"
export CSAR_DIR=/opt/csar
export KUBE_CONFIG_DIR=/opt/kubeconfig
-export DATABASE_TYPE=consul
+export DATABASE_TYPE=mongo
export PLUGINS_DIR=$k8s_path/src/k8splugin/plugins
-echo "Starting consul services"
+echo "Starting mongo services"
docker-compose kill
-docker-compose up -d consul
-export DATABASE_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aqf "name=consul"))
+docker-compose up -d mongo
+export DATABASE_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aqf "name=mongo"))
export no_proxy=$no_proxy,$DATABASE_IP
export NO_PROXY=$NO_PROXY,$DATABASE_IP