add glusterfs templates

This commit is contained in:
James Oliver
2016-03-21 16:50:08 -07:00
parent 757f993e08
commit 2567a3f3a8
5 changed files with 1021 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
## GlusterFS (Experimental)
### Info:
This creates a 3 node GlusterFS cluster with a single replicated volume. The volume can be used within the Rancher Managed network, or exposed through the host to clients outside of Rancher. You can add additional nodes to the Gluster cluster, but they will not be added to the original volume pool.
Once created, this stack takes a hands off approach to managing Glusterfs. The only exception is that new instances will be added to the Gluster pool, but not added to the volume. Users are expected to manage GlusterFS.
### Pre-reqs
##### Rancher Managed Network: None
##### Host Networking:
* 3x Nodes - The Gluster Daemon will be listening on the host IP, and it will have port conflict if more then one instance is running on the same host.
* Every host needs the following ports open to each other and clients:
* 24007
* 24007/udp
* 24008
* 24008/udp
* 49152
* ICMP
* DNS needs to resolve for the GlusterFS server nodes between each server node and the clients.
### Usage
Select the GlusterFS app from the Rancher Catalog. By default, the volume name will be my_vol, but you can update the volume name before creation.
You will also need to select the network mode. The choices are 'container:glusterfs-server' and 'host'. To run GlusterFS for use with Convoy or just over the Rancher managed network, select the 'container:glusterfs-server' option. If you want to run GlusterFS for clients outside of Rancher, and are running on a secure network, select the host networking mode.
### Mounting
If mounting inside of another container on the network, the client container will need be launched on a host with the fuse kernel module and have `--device=/dev/fuse:/dev/fuse` and at least `--cap_add=SYS_ADMIN`. (On Ubuntu hosts there is an issue with AppArmor that requires `--privileged`)
On the Rancher Managed Network, you are able to mount via the containers IP addresses.
On the host network mode, mount the volume via the hostnames.
+46
View File
@@ -0,0 +1,46 @@
glusterfs-server:
image: rancher/glusterfs:v0.2.1
volumes_from:
- glusterfs-data
labels:
io.rancher.container.hostname_override: container_name
io.rancher.sidekicks: glusterfs-daemon,glusterfs-data,glusterfs-volume-create
command: giddyup leader elect --proxy-tcp-port=2160 /opt/rancher/peerprobe.sh ${network_mode}
glusterfs-daemon:
image: rancher/glusterfs:v0.2.1
net: ${network_mode}
cap_add:
- SYS_ADMIN
volumes_from:
- glusterfs-data
labels:
io.rancher.container.dns: 'true'
io.rancher.container.network: 'true'
io.rancher.container.hostname_override: container_name
io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/glusterfs-server
command: glusterd -p /var/run/gluster.pid --no-daemon --log-file=-
glusterfs-volume-create:
image: rancher/glusterfs:v0.2.1
command: /opt/rancher/replicated_volume_create.sh ${network_mode}
net: 'container:glusterfs-server'
volumes_from:
- glusterfs-data
labels:
io.rancher.container.hostname_override: container_name
io.rancher.container.start_once: true
#
# WARNING -- DO NOT CHANGE ANYTHING BELOW
# DATA LOSS!!!! CAN OCCURR DURING UPGRADE
#
glusterfs-data:
image: busybox
command: /bin/true
net: none
volumes:
- /var/run
- /var/lib/glusterd
labels:
io.rancher.container.hostname_override: container_name
io.rancher.container.start_once: true
+29
View File
@@ -0,0 +1,29 @@
.catalog:
name: "GlusterFS"
version: "3.7.9-rancher1"
description: "Gluster FS (3x) replicated volume"
questions:
- variable: "VOLUME_NAME"
description: "Name to give the Gluster volume"
label: "Volume Name"
required: true
default: "my_vol"
type: "string"
- variable: "network_mode"
description: |
To use Gluster on the rancher network, use the default setting.
If you want to expose Gluster to non-Rancher clients, use host.
Take note, that Gluster will be accessible to anything accessible to
the host. Do not use this configuration in an untrusted setting.
label: "Gluster Networking Mode"
required: true
type: "enum"
default: "container:glusterfs-server"
options:
- "container:glusterfs-server"
- "host"
glusterfs-server:
scale: 3
retain_ip: true
metadata:
volume_name: "${VOLUME_NAME}"