Upgrade to mongo 3.4 and added volume driver choice
This commit is contained in:
parent
ef67c597a0
commit
feb0eac179
18
templates/MongoDB/3/README.md
Normal file
18
templates/MongoDB/3/README.md
Normal file
@ -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.
|
||||||
|
|
42
templates/MongoDB/3/docker-compose.yml
Normal file
42
templates/MongoDB/3/docker-compose.yml
Normal file
@ -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}
|
52
templates/MongoDB/3/rancher-compose.yml
Normal file
52
templates/MongoDB/3/rancher-compose.yml
Normal file
@ -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}"
|
@ -1,5 +1,5 @@
|
|||||||
name: MongoDB
|
name: MongoDB
|
||||||
description: |
|
description: |
|
||||||
MongoDB Replica Set.
|
MongoDB Replica Set.
|
||||||
version: 3.2-rancher2
|
version: "3.4-rancher1"
|
||||||
category: Databases
|
category: Databases
|
||||||
|
Loading…
x
Reference in New Issue
Block a user