diff --git a/templates/MongoDB/3/README.md b/templates/MongoDB/3/README.md new file mode 100644 index 0000000..5d1109f --- /dev/null +++ b/templates/MongoDB/3/README.md @@ -0,0 +1,18 @@ +# MongoDB + + +### Info: + + This template creates MongoDB replica set on top of Rancher. Replica set size starts with 3 MongoDB instances, the replica set has the ability to scale up automatically when adding new instances. + + +### Usage: + + Select MongoDB from catalog. + + Enter the name of the replica set. + + Click deploy. + + MongoDB can now be accessed over the Rancher network. + diff --git a/templates/MongoDB/3/docker-compose.yml b/templates/MongoDB/3/docker-compose.yml new file mode 100644 index 0000000..fb26491 --- /dev/null +++ b/templates/MongoDB/3/docker-compose.yml @@ -0,0 +1,42 @@ +version: '2' +services: + mongo-cluster: + restart: always + environment: + MONGO_SERVICE_NAME: mongo-cluster + CATTLE_SCRIPT_DEBUG: ${debug} + entrypoint: /opt/rancher/bin/entrypoint.sh + command: + - --replSet + - "${replset_name}" + image: mongo:3.4 + labels: + io.rancher.scheduler.affinity:host_label: ${host_label} + io.rancher.container.hostname_override: container_name + io.rancher.sidekicks: mongo-base, mongo-datavolume + volumes_from: + - mongo-datavolume + - mongo-base + ports: + - 27017:27017/tcp + mongo-base: + restart: always + labels: + io.rancher.scheduler.affinity:host_label: ${host_label} + io.rancher.container.hostname_override: container_name + io.rancher.container.start_once: true + image: rancher/mongodb-conf:v0.1.1 + stdin_open: true + entrypoint: /bin/true + mongo-datavolume: + labels: + io.rancher.scheduler.affinity:host_label: ${host_label} + io.rancher.container.hostname_override: container_name + io.rancher.container.start_once: true + volumes: + - mongodata:/data/db + entrypoint: /bin/true + image: busybox +volumes: + mongodata: + driver: ${VOLUME_DRIVER} diff --git a/templates/MongoDB/3/rancher-compose.yml b/templates/MongoDB/3/rancher-compose.yml new file mode 100644 index 0000000..8c90ba7 --- /dev/null +++ b/templates/MongoDB/3/rancher-compose.yml @@ -0,0 +1,52 @@ +version: '2' +catalog: + name: "MongoDB" + version: "3.4-rancher1" + description: "MongoDB Replica Set" + uuid: mongodb-1 + minimum_rancher_version: v0.46.0 + questions: + - variable: replset_name + description: "Name of the MongoDB replicaSet" + label: "ReplicaSet Name" + type: "string" + required: true + default: "rs0" + - variable: host_label + label: "Host Label to MongoDB Tags" + description: | + Host label to use as MongoDB 'value' tag. + Example: 'database' + required: false + type: "string" + - variable: debug + description: "Enable Debug log for Mongo containers" + label: "Debug" + type: "string" + required: false + default: "" + - variable: "VOLUME_DRIVER" + description: "The VOLUME driver to associate with this server" + label: "VOLUME Driver" + required: true + default: "local" + type: enum + options: + - local + - rancher-nfs + - rancher-efs + - rancher-ebs + - variable: mongo_scale + description: "How many containers the MongoDB will scale to?" + label: "mongo scale" + type: "int" + required: true + default: "3" +services: + mongo-cluster: + scale: ${mongo_scale} + retain_ip: true + metadata: + mongo: + yml: + replset.name: "${replset_name}" diff --git a/templates/MongoDB/config.yml b/templates/MongoDB/config.yml index 4ea53c1..31cda18 100644 --- a/templates/MongoDB/config.yml +++ b/templates/MongoDB/config.yml @@ -1,5 +1,5 @@ name: MongoDB description: | MongoDB Replica Set. -version: 3.2-rancher2 +version: "3.4-rancher1" category: Databases