From 74495c9ab577c309580e36625ba01d98815cd8f5 Mon Sep 17 00:00:00 2001 From: deniseschannon Date: Wed, 23 Nov 2016 22:50:25 -0800 Subject: [PATCH 1/2] Move mesos/swarm to infra-templates --- infra-templates/mesos/0/docker-compose.yml | 48 ++++++++ infra-templates/mesos/0/rancher-compose.yml | 31 +++++ infra-templates/mesos/catalogIcon-mesos.svg | 76 ++++++++++++ infra-templates/mesos/config.yml | 3 + infra-templates/swarm/0/docker-compose.yml | 23 ++++ infra-templates/swarm/0/rancher-compose.yml | 24 ++++ infra-templates/swarm/README.md | 20 ++++ infra-templates/swarm/catalogIcon-swarm.svg | 124 ++++++++++++++++++++ infra-templates/swarm/config.yml | 5 + 9 files changed, 354 insertions(+) create mode 100644 infra-templates/mesos/0/docker-compose.yml create mode 100644 infra-templates/mesos/0/rancher-compose.yml create mode 100644 infra-templates/mesos/catalogIcon-mesos.svg create mode 100644 infra-templates/mesos/config.yml create mode 100644 infra-templates/swarm/0/docker-compose.yml create mode 100644 infra-templates/swarm/0/rancher-compose.yml create mode 100644 infra-templates/swarm/README.md create mode 100644 infra-templates/swarm/catalogIcon-swarm.svg create mode 100644 infra-templates/swarm/config.yml diff --git a/infra-templates/mesos/0/docker-compose.yml b/infra-templates/mesos/0/docker-compose.yml new file mode 100644 index 0000000..bf4c5c7 --- /dev/null +++ b/infra-templates/mesos/0/docker-compose.yml @@ -0,0 +1,48 @@ +zookeeper: + image: rancher/zookeeper:3.4.8 + environment: + ZK_ENSEMBLE_SIZE: 3 + JVMFLAGS: -Xmx512m -Xms512m + CONFD_INTERVAL: 0 + labels: + io.rancher.scheduler.affinity:container_label_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + io.rancher.sidekicks: zookeeper-data + volumes_from: + - zookeeper-data +zookeeper-data: + image: busybox + entrypoint: /bin/true + labels: + io.rancher.scheduler.affinity:container_label_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + io.rancher.container.start_once: 'true' + net: none + volumes: + - /data +mesos-master: + image: rancher/mesos-master:latest + environment: + MESOS_CLUSTER: Rancher + MESOS_QUORUM: 2 + MASTER_PORT: 5050 + ZK_SERVICE: Mesos/zookeeper + ZK_SESSION_TIMEOUT: 10secs + ports: + - "5050:5050" + labels: + io.rancher.scheduler.affinity:container_label_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + volumes: + - /data +mesos-slave: + image: rancher/mesos-slave:latest + environment: + SLAVE_PORT: 5051 + ZK_SERVICE: Mesos/zookeeper + ports: + - "5051:5051" + labels: + io.rancher.scheduler.affinity:container_label_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + io.rancher.scheduler.global: "true" + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - /data + privileged: true diff --git a/infra-templates/mesos/0/rancher-compose.yml b/infra-templates/mesos/0/rancher-compose.yml new file mode 100644 index 0000000..203eb40 --- /dev/null +++ b/infra-templates/mesos/0/rancher-compose.yml @@ -0,0 +1,31 @@ +.catalog: + version: v0.28.0 + +zookeeper: + scale: 3 + retain_ip: true + health_check: + port: 2181 + interval: 5000 + unhealthy_threshold: 3 + request_line: '' + healthy_threshold: 2 + response_timeout: 5000 +mesos-master: + scale: 3 + retain_ip: true + health_check: + port: 5050 + interval: 3000 + unhealthy_threshold: 2 + healthy_threshold: 2 + request_line: '/metrics/snapshot' + response_timeout: 2000 +mesos-slave: + health_check: + port: 5051 + interval: 5000 + unhealthy_threshold: 2 + healthy_threshold: 2 + request_line: '' + response_timeout: 3000 diff --git a/infra-templates/mesos/catalogIcon-mesos.svg b/infra-templates/mesos/catalogIcon-mesos.svg new file mode 100644 index 0000000..eb0e3d8 --- /dev/null +++ b/infra-templates/mesos/catalogIcon-mesos.svg @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/infra-templates/mesos/config.yml b/infra-templates/mesos/config.yml new file mode 100644 index 0000000..68f8324 --- /dev/null +++ b/infra-templates/mesos/config.yml @@ -0,0 +1,3 @@ +name: Mesos +version: v0.28.0 +category: Orchestration diff --git a/infra-templates/swarm/0/docker-compose.yml b/infra-templates/swarm/0/docker-compose.yml new file mode 100644 index 0000000..9fcbc85 --- /dev/null +++ b/infra-templates/swarm/0/docker-compose.yml @@ -0,0 +1,23 @@ +version: '2' +services: + swarmkit-mon: + image: llparse/swarmkit:v1.12-4 + environment: + MANAGER_SCALE: ${MANAGER_SCALE} + labels: + io.rancher.container.agent.role: environment + io.rancher.container.create_agent: 'true' + io.rancher.container.dns: 'true' + io.rancher.container.pull_image: always + io.rancher.scheduler.affinity:host_label: io.rancher.host.docker_version=1.12 + io.rancher.scheduler.global: 'true' + network_mode: host + privileged: true + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - /var/lib/rancher/state:/var/lib/rancher/state + logging: + driver: json-file + options: + max-size: 25m + max-file: '2' diff --git a/infra-templates/swarm/0/rancher-compose.yml b/infra-templates/swarm/0/rancher-compose.yml new file mode 100644 index 0000000..8ee9982 --- /dev/null +++ b/infra-templates/swarm/0/rancher-compose.yml @@ -0,0 +1,24 @@ +.catalog: + version: v1.12-rancher0 + minimum_rancher_version: 1.1.99 + questions: + - variable: MANAGER_SCALE + label: Number of Managers + description: Desired number of managers to participating in service orchestration. This dictates host resilience. + required: true + default: 3 + type: enum + options: + - 1 + - 3 + - 5 + - 7 + - 9 +swarmkit-mon: + health_check: + request_line: GET /ping HTTP/1.0 + port: 2378 + interval: 15000 + response_timeout: 10000 + healthy_threshold: 1 + unhealthy_threshold: 2 diff --git a/infra-templates/swarm/README.md b/infra-templates/swarm/README.md new file mode 100644 index 0000000..614a4d1 --- /dev/null +++ b/infra-templates/swarm/README.md @@ -0,0 +1,20 @@ +## Prerequisites + +* Port `2377` and `2378` must be open +* Docker v1.12.1 installed + +SwarmKit's overlay network configuration must determine which interface will be used for cross-host communication. By default, Rancher routes traffic over public IP addresses. Swarm can't always detect the corresponding interface; you may need to do one of the following: + +* Register hosts with CATTLE_AGENT_IP environment variable set to a system address +* Specify the host interface for Swarm to listen on (hosts must have the same interface name) + +## Features + +* Automatically scale up/down a Swarm by adding/removing hosts to an environment + * Do not attempt to run `docker swarm` commands manually +* Configurable number of managers tunable to desired [failure tolerance](https://docs.docker.com/engine/swarm/admin_guide/#/add-manager-nodes-for-fault-tolerance) +* Reconciliation logic promotes/demotes managers/workers to maintain resilience + +## Limitations + +* Swarm over public networks is not supported in Docker 1.12.3 and older \ No newline at end of file diff --git a/infra-templates/swarm/catalogIcon-swarm.svg b/infra-templates/swarm/catalogIcon-swarm.svg new file mode 100644 index 0000000..9e51aa8 --- /dev/null +++ b/infra-templates/swarm/catalogIcon-swarm.svg @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/infra-templates/swarm/config.yml b/infra-templates/swarm/config.yml new file mode 100644 index 0000000..31c8ff0 --- /dev/null +++ b/infra-templates/swarm/config.yml @@ -0,0 +1,5 @@ +name: SwarmKit +description: > + A toolkit for orchestrating distributed systems at any scale +version: v1.12-rancher0 +category: Orchestration From cf9afdd52424c49fe73b580f037c904e4ea4169e Mon Sep 17 00:00:00 2001 From: deniseschannon Date: Fri, 25 Nov 2016 16:41:27 -0800 Subject: [PATCH 2/2] min version on mesos and swarm --- infra-templates/mesos/0/rancher-compose.yml | 2 +- infra-templates/swarm/0/rancher-compose.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/infra-templates/mesos/0/rancher-compose.yml b/infra-templates/mesos/0/rancher-compose.yml index 203eb40..c1308eb 100644 --- a/infra-templates/mesos/0/rancher-compose.yml +++ b/infra-templates/mesos/0/rancher-compose.yml @@ -1,6 +1,6 @@ .catalog: version: v0.28.0 - + minimum_rancher_version: 1.2.0-pre4-rc1 zookeeper: scale: 3 retain_ip: true diff --git a/infra-templates/swarm/0/rancher-compose.yml b/infra-templates/swarm/0/rancher-compose.yml index 8ee9982..30b5446 100644 --- a/infra-templates/swarm/0/rancher-compose.yml +++ b/infra-templates/swarm/0/rancher-compose.yml @@ -1,6 +1,6 @@ .catalog: version: v1.12-rancher0 - minimum_rancher_version: 1.1.99 + minimum_rancher_version: 1.2.0-pre4-rc1 questions: - variable: MANAGER_SCALE label: Number of Managers