diff --git a/machine-templates/cloudca/1/checksum b/machine-templates/cloudca/1/checksum new file mode 100644 index 0000000..6005709 --- /dev/null +++ b/machine-templates/cloudca/1/checksum @@ -0,0 +1 @@ +100bf1dc97f5016602457ba397433561 diff --git a/machine-templates/cloudca/1/rancher-compose.yml b/machine-templates/cloudca/1/rancher-compose.yml new file mode 100644 index 0000000..405ebb3 --- /dev/null +++ b/machine-templates/cloudca/1/rancher-compose.yml @@ -0,0 +1,3 @@ +.catalog: + name: cloudca + version: "v1.0.2" diff --git a/machine-templates/cloudca/1/uiUrl b/machine-templates/cloudca/1/uiUrl new file mode 100644 index 0000000..a39e32f --- /dev/null +++ b/machine-templates/cloudca/1/uiUrl @@ -0,0 +1 @@ +https://objects-east.cloud.ca/v1/5ef827605f884961b94881e928e7a250/rancher-ui-driver/v1.0.2/component.js diff --git a/machine-templates/cloudca/1/url b/machine-templates/cloudca/1/url new file mode 100644 index 0000000..7d2343e --- /dev/null +++ b/machine-templates/cloudca/1/url @@ -0,0 +1 @@ +https://objects-east.cloud.ca/v1/5ef827605f884961b94881e928e7a250/docker-machine-driver-cloudca/v1.0.2/docker-machine-driver-cloudca_v1.0.2_linux-amd64.zip diff --git a/machine-templates/cloudca/config.yml b/machine-templates/cloudca/config.yml index f63e58e..ab1cf0e 100644 --- a/machine-templates/cloudca/config.yml +++ b/machine-templates/cloudca/config.yml @@ -1,2 +1,2 @@ name: cloudca -version: "v1.0.1" +version: "v1.0.2" 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..98e7dd3 --- /dev/null +++ b/templates/MongoDB/3/docker-compose.yml @@ -0,0 +1,45 @@ +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:container_label_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + 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:container_label_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + 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:container_label_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + 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 diff --git a/templates/drone/4/README.md b/templates/drone/4/README.md new file mode 100644 index 0000000..0349171 --- /dev/null +++ b/templates/drone/4/README.md @@ -0,0 +1,19 @@ +# Drone + +### Info: + +This template creates an instance of Drone CI server 0.8 along with selectable number of agents to perform the builds. + +### Usage: + +Select the Drone template from the catalog. Provide the following information: + +1. Publish port +2. Agents scale +3. Drone secret +4. Run mode. debug | release +3. Remote driver and config. (Ie. GitHub) +4. Database driver and config. (Ie. sqlite) + + +See [Drone documentation](http://readme.drone.io/admin) for complete information. diff --git a/templates/drone/4/docker-compose.yml.tpl b/templates/drone/4/docker-compose.yml.tpl new file mode 100644 index 0000000..b2ed55b --- /dev/null +++ b/templates/drone/4/docker-compose.yml.tpl @@ -0,0 +1,116 @@ +version: '2' +services: + agent: + image: drone/agent:${drone_version} + environment: + DRONE_SERVER: ${drone_server} + DRONE_SECRET: ${drone_secret} +{{- if (.Values.http_proxy)}} + HTTP_PROXY: ${http_proxy} + http_proxy: ${http_proxy} +{{- end}} +{{- if (.Values.https_proxy)}} + HTTPS_PROXY: ${https_proxy} + https_proxy: ${https_proxy} +{{- end}} +{{- if (.Values.no_proxy)}} + NO_PROXY: ${no_proxy} + no_proxy: ${no_proxy} +{{- end}} + volumes: + - /var/run/docker.sock:/var/run/docker.sock + links: + - server:drone + command: + - agent + labels: + io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + io.rancher.container.hostname_override: container_name + server: + image: drone/drone:${drone_version} + environment: + DRONE_HOST: ${drone_host} + GIN_MODE: ${gin_mode} +{{- if (.Values.drone_debug)}} + DRONE_DEBUG: '${drone_debug}' +{{- end}} + DRONE_SECRET: ${drone_secret} + DRONE_OPEN: ${drone_open} +{{- if (.Values.drone_admin)}} + DRONE_ADMIN: ${drone_admins} +{{- end}} +{{- if (.Values.drone_orgs)}} + DRONE_ORGS: ${drone_orgs} +{{- end}} +{{- if eq .Values.drone_driver "GitHub"}} + DRONE_GITHUB: true + DRONE_GITHUB_CLIENT: ${drone_driver_client} + DRONE_GITHUB_SECRET: ${drone_driver_secret} +{{- end}} +{{- if eq .Values.drone_driver "Bitbucket Cloud"}} + DRONE_BITBUCKET: true + DRONE_BITBUCKET_CLIENT: ${drone_driver_client} + DRONE_BITBUCKET_SECRET: ${drone_driver_secret} +{{- end}} +{{- if eq .Values.drone_driver "Bitbucket Server"}} + DRONE_STASH: true + DRONE_STASH_GIT_USERNAME: ${drone_driver_user} + DRONE_STASH_GIT_PASSWORD: ${drone_driver_password} + DRONE_STASH_CONSUMER_KEY: ${drone_driver_client} + DRONE_STASH_CONSUMER_RSA_STRING: ${drone_driver_secret} + DRONE_STASH_URL: ${drone_driver_url} +{{- end}} +{{- if eq .Values.drone_driver "GitLab"}} + DRONE_GITLAB: true + DRONE_GITLAB_CLIENT: ${drone_driver_secret} + DRONE_GITLAB_SECRET: ${drone_driver_secret} + DRONE_GITLAB_URL: ${drone_driver_url} +{{- end}} +{{- if eq .Values.drone_driver "Gogs"}} + DRONE_GOGS: true + DRONE_GOGS_URL: ${drone_driver_url} +{{- end}} +{{- if ne .Values.database_driver "sqlite"}} + DRONE_DATABASE_DRIVER: ${database_driver} + DRONE_DATABASE_DATASOURCE: ${database_source} +{{- end}} +{{- if (.Values.http_proxy)}} + HTTP_PROXY: ${http_proxy} + http_proxy: ${http_proxy} +{{- end}} +{{- if (.Values.https_proxy)}} + HTTPS_PROXY: ${https_proxy} + https_proxy: ${https_proxy} +{{- end}} +{{- if (.Values.no_proxy)}} + NO_PROXY: ${no_proxy} + no_proxy: ${no_proxy} +{{- end}} + labels: + io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + io.rancher.container.hostname_override: container_name +{{- if eq .Values.database_driver "sqlite"}} + io.rancher.sidekicks: server-volume + volumes_from: + - server-volume + server-volume: + image: rawmind/alpine-volume:0.0.2-1 + environment: + SERVICE_GID: '0' + SERVICE_UID: '0' + SERVICE_VOLUME: /var/lib/drone + network_mode: none + volumes: + - /var/lib/drone + labels: + io.rancher.container.start_once: 'true' + io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + io.rancher.container.hostname_override: container_name +{{- end}} + lb: + image: rancher/lb-service-haproxy:v0.6.4 + ports: + - ${host_port}:${host_port} + labels: + io.rancher.scheduler.global: 'true' + io.rancher.scheduler.affinity:host_label_soft: ${drone_lb_host_label} diff --git a/templates/drone/4/rancher-compose.yml b/templates/drone/4/rancher-compose.yml new file mode 100644 index 0000000..ee8bbec --- /dev/null +++ b/templates/drone/4/rancher-compose.yml @@ -0,0 +1,188 @@ +version: 2 +catalog: + name: Drone + version: 0.8.0-rc.1-rancher1 + upgrade_from: 0.5-rancher1 + description: | + Drone CI Server ref http://readme.drone.io/admin/installation-guide/ + questions: + - variable: drone_host + label: Drone Host URL + description: Intended URL Drone will be hosted on, e.g. http://drone.mycompany.com. + required: true + type: string + - variable: host_port + label: Drone Server Host Port + description: Public port that will be exposed on service creation. + required: true + default: 8000 + type: int + - variable: agent_scale + label: Drone Agent Scale + description: Drone agent scale to deploy + required: true + default: 1 + type: int + - variable: drone_secret + label: Server and Agents Secret + description: Server and agents secret to be communicate. http://readme.drone.io/admin/user-registration/ + type: password + required: true + - variable: gin_mode + label: Run mode + description: "Drone run mode, GIN_MODE" + type: enum + default: "release" + options: + - "release" + - "debug" + required: true + - variable: drone_open + label: Open Registration + description: | + Users self register. http://readme.drone.io/admin/user-registration/ + required: true + default: true + type: enum + options: + - true + - false + - variable: drone_admin + label: Drone Admin + description: List of admins for drone comma seperated. http://readme.drone.io/admin/user-admins/ + type: string + required: false + - variable: drone_orgs + label: Organizations + description: Comman seperated list of org that can access drone. http://readme.drone.io/admin/user-registration/ + type: string + required: false + - variable: "drone_driver" + type: "enum" + required: true + label: "Remote Driver" + default: "GitHub" + description: "Remote Git and Auth scheme. ref http://readme.drone.io/admin" + options: + - GitHub + - GitLab + - Gogs + - Bitbucket Cloud + - Bitbucket Server + - variable: drone_driver_client + label: Remote Driver Client + description: "Client key from remote driver. Required for GitHub, Bitbucket Cloud, Bitbucket Server and GitLab." + type: string + required: false + - variable: drone_driver_secret + label: Remote Driver Secret + description: "Secret key from remote driver. Required for GitHub, Bitbucket Cloud, Bitbucket Server and GitLab." + type: multiline + required: false + - variable: drone_driver_url + label: Remote Driver URL + description: "Remote Driver server url. Required for GitLab, Gogs and Bitbucket Server; see http://readme.drone.io/admin." + type: string + required: false + - variable: drone_driver_user + label: Remote Driver Username + description: "Remote Driver username. Required for BitBucket Server; see http://docs.drone.io/install-for-bitbucket-server/." + type: string + required: false + - variable: drone_driver_password + label: Remote Driver Password + description: "Remote Driver password. Required for BitBucket Server, http://docs.drone.io/install-for-bitbucket-server/." + type: password + required: false + - variable: drone_server + label: Drone Server + description: "Drone sever identifier. Used by the agent to connect to the server (does not require change)." + type: string + default: "drone:9000" + - variable: drone_version + label: Drone Version + description: "Drone version/Docker tag used for the Drone container images." + type: enum + default: "0.8.0-rc.1" + options: + - 0.8.0-rc.1 + - 0.8.0 + - '0.8' + - latest + - variable: database_driver + label: Database Driver + description: "Database driver. If sqlite, additional volume would be mounted at /var/lib/drone." + type: enum + default: "sqlite" + options: + - "sqlite" + - "mysql" + - "postgres" + required: true + - variable: "database_source" + type: "string" + label: "Database source" + description: "Database datasource. Required if database driver is mysql or postgres, http://readme.drone.io/admin/database-engines/" + required: false + - variable: "http_proxy" + type: string + label: HTTP Proxy + description: "Optional: HTTP forward proxy URL." + required: false + - variable: "https_proxy" + type: string + label: HTTPS Proxy + description: "Optional: HTTPS forward proxy URL." + required: false + - variable: "no_proxy" + type: string + label: No Proxy + description: "Optional: No proxy hosts (comma-separated hostnames/IPs)." + required: false + default: "drone" + - variable: "drone_debug" + label: Drone Debug + description: "Enable debug output with the Drone server." + type: enum + options: + - 'true' + - 'false' + default: 'false' + - variable: drone_lb_host_label + label: Drone LB Host Label + description: Host label (soft affinity) for scheduling of the load balancer service. + required: true + default: "drone_lb=true" + type: string +services: + agent: + scale: ${agent_scale} + start_on_create: true + server: + scale: 1 + start_on_create: true + health_check: + port: 8000 + interval: 2000 + unhealthy_threshold: 3 + strategy: recreate + request_line: GET / HTTP/1.0 + healthy_threshold: 2 + response_timeout: 2000 + lb: + start_on_create: true + lb_config: + certs: [] + port_rules: + - priority: 1 + protocol: http + service: server + source_port: ${host_port} + target_port: 8000 + health_check: + healthy_threshold: 2 + response_timeout: 2000 + port: 42 + unhealthy_threshold: 3 + interval: 2000 + strategy: recreate diff --git a/templates/drone/config.yml b/templates/drone/config.yml index d30faef..e501783 100644 --- a/templates/drone/config.yml +++ b/templates/drone/config.yml @@ -1,5 +1,5 @@ name: Drone description: | Drone CI Server -version: 0.7.1-rancher1 +version: 0.8.0-rc.1-rancher1 category: Continuous Integration diff --git a/templates/es-cluster/2/README.md b/templates/es-cluster/2/README.md new file mode 100644 index 0000000..c662188 --- /dev/null +++ b/templates/es-cluster/2/README.md @@ -0,0 +1,5 @@ +# Elasticsearch Cluster + +A scalable Elasticsearch cluster + +WARN: To avoid vm.max_map_count errors you could set "Update host sysctl" to true. Then param vm.max_map_count will be update to 262144 if it's less in your hosts. diff --git a/templates/es-cluster/2/docker-compose.yml.tpl b/templates/es-cluster/2/docker-compose.yml.tpl new file mode 100644 index 0000000..f4706fd --- /dev/null +++ b/templates/es-cluster/2/docker-compose.yml.tpl @@ -0,0 +1,131 @@ +version: '2' +services: + es-master: + labels: + io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + io.rancher.container.hostname_override: container_name + io.rancher.sidekicks: es-storage + {{- if eq .Values.UPDATE_SYSCTL "true" -}} + ,es-sysctl + {{- end}} + image: docker.elastic.co/elasticsearch/elasticsearch:5.4.2 + environment: + - "cluster.name=${cluster_name}" + - "node.name=$${HOSTNAME}" + - "bootstrap.memory_lock=true" + - "xpack.security.enabled=false" + - "ES_JAVA_OPTS=-Xms${master_heap_size} -Xmx${master_heap_size}" + - "discovery.zen.ping.unicast.hosts=es-master" + - "discovery.zen.minimum_master_nodes=${minimum_master_nodes}" + - "node.master=true" + - "node.data=false" + ulimits: + memlock: + soft: -1 + hard: -1 + nofile: + soft: 65536 + hard: 65536 + mem_limit: ${master_mem_limit} + mem_swappiness: 0 + cap_add: + - IPC_LOCK + volumes_from: + - es-storage + + es-data: + labels: + io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + io.rancher.container.hostname_override: container_name + io.rancher.sidekicks: es-storage + {{- if eq .Values.UPDATE_SYSCTL "true" -}} + ,es-sysctl + {{- end}} + image: docker.elastic.co/elasticsearch/elasticsearch:5.4.2 + environment: + - "cluster.name=${cluster_name}" + - "node.name=$${HOSTNAME}" + - "bootstrap.memory_lock=true" + - "xpack.security.enabled=false" + - "discovery.zen.ping.unicast.hosts=es-master" + - "ES_JAVA_OPTS=-Xms${data_heap_size} -Xmx${data_heap_size}" + - "node.master=false" + - "node.data=true" + ulimits: + memlock: + soft: -1 + hard: -1 + nofile: + soft: 65536 + hard: 65536 + mem_limit: ${data_mem_limit} + mem_swappiness: 0 + cap_add: + - IPC_LOCK + volumes_from: + - es-storage + depends_on: + - es-master + + es-client: + labels: + io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + io.rancher.container.hostname_override: container_name + io.rancher.sidekicks: es-storage + {{- if eq .Values.UPDATE_SYSCTL "true" -}} + ,es-sysctl + {{- end}} + image: docker.elastic.co/elasticsearch/elasticsearch:5.4.2 + environment: + - "cluster.name=${cluster_name}" + - "node.name=$${HOSTNAME}" + - "bootstrap.memory_lock=true" + - "xpack.security.enabled=false" + - "discovery.zen.ping.unicast.hosts=es-master" + - "ES_JAVA_OPTS=-Xms${client_heap_size} -Xmx${client_heap_size}" + - "node.master=false" + - "node.data=false" + ulimits: + memlock: + soft: -1 + hard: -1 + nofile: + soft: 65536 + hard: 65536 + mem_limit: ${client_mem_limit} + mem_swappiness: 0 + cap_add: + - IPC_LOCK + volumes_from: + - es-storage + depends_on: + - es-master + + es-storage: + labels: + io.rancher.container.start_once: true + network_mode: none + image: rawmind/alpine-volume:0.0.2-1 + environment: + - SERVICE_UID=1000 + - SERVICE_GID=1000 + - SERVICE_VOLUME=/usr/share/elasticsearch/data + volumes: + - es-storage-volume:/usr/share/elasticsearch/data + + {{- if eq .Values.UPDATE_SYSCTL "true" }} + es-sysctl: + labels: + io.rancher.container.start_once: true + network_mode: none + image: rawmind/alpine-sysctl:0.1 + privileged: true + environment: + - "SYSCTL_KEY=vm.max_map_count" + - "SYSCTL_VALUE=262144" + {{- end}} + +volumes: + es-storage-volume: + driver: ${VOLUME_DRIVER} + per_container: true diff --git a/templates/es-cluster/2/rancher-compose.yml b/templates/es-cluster/2/rancher-compose.yml new file mode 100644 index 0000000..aefd049 --- /dev/null +++ b/templates/es-cluster/2/rancher-compose.yml @@ -0,0 +1,111 @@ +version: '2' +catalog: + name: Elasticsearch Cluster + version: 5.4.2-rancher2 + description: Scalable Elasticsearch Cluster + + questions: + - variable: "cluster_name" + type: "string" + required: true + label: "Cluster name" + description: "Name of the Elasticsearch Cluster" + default: "es-cluster" + + - variable: "UPDATE_SYSCTL" + label: "Update host sysctl:" + description: | + Set true to avoid vm.max_map_count errors. + WARN: If set true, host param vm.max_map_count will be update to 262144. + default: false + required: true + type: enum + options: + - false + - true + + - variable: "master_heap_size" + type: "string" + required: true + label: "Heap size (master nodes)" + description: "Heap size to be allocated for Java (mater nodes)" + default: "512m" + + - variable: "master_mem_limit" + type: "int" + required: true + label: "Memory limit in byte (master nodes)" + description: "Memory limit in Byte per elasticsearch container. AT LEAST double the heap size! (master nodes)" + default: 1073741824 + + - variable: "data_heap_size" + type: "string" + required: true + label: "Heap size (data nodes)" + description: "Heap size to be allocated for Java (mater nodes)" + default: "512m" + + - variable: "data_mem_limit" + type: "int" + required: true + label: "Memory limit in byte (data nodes)" + description: "Memory limit in Byte per elasticsearch container. AT LEAST double the heap size! (data nodes)" + default: 1073741824 + + - variable: "client_heap_size" + type: "string" + required: true + label: "Heap size (client nodes)" + description: "Heap size to be allocated for Java (mater nodes)" + default: "512m" + + - variable: "client_mem_limit" + type: "int" + required: true + label: "Memory limit in byte (client nodes)" + description: "Memory limit in Byte per elasticsearch container. AT LEAST double the heap size! (client nodes)" + default: 1073741824 + + - variable: "minimum_master_nodes" + type: "int" + required: true + label: "# of minimum Master Nodes" + description: "Set the number of required master nodes to reach quorum. Sets initial scale to this value as well" + default: 3 + + - variable: "initial_data_nodes" + type: "int" + required: true + label: "# of initial data nodes" + description: "Set the initial number of data nodes" + default: 2 + + - variable: "initial_client_nodes" + type: "int" + required: true + label: "# of initial client nodes" + description: "Set the initial number of client nodes" + default: 1 + + - 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 + +services: + + es-master: + scale: ${minimum_master_nodes} + + es-data: + scale: ${initial_data_nodes} + + es-client: + scale: ${initial_client_nodes} diff --git a/templates/es-cluster/config.yml b/templates/es-cluster/config.yml index 8b9077b..a0984cb 100644 --- a/templates/es-cluster/config.yml +++ b/templates/es-cluster/config.yml @@ -1,5 +1,5 @@ name: Elasticsearch Cluster 5.4.2 description: | Elasticsearch, you know for search! -version: 5.4.2-rancher1 -category: ELK \ No newline at end of file +version: 5.4.2-rancher2 +category: ELK diff --git a/templates/janitor/4/docker-compose.yml b/templates/janitor/4/docker-compose.yml new file mode 100644 index 0000000..431ade2 --- /dev/null +++ b/templates/janitor/4/docker-compose.yml @@ -0,0 +1,20 @@ +cleanup: + image: meltwater/docker-cleanup:1.8.0 + environment: + CLEAN_PERIOD: ${FREQUENCY} + DELAY_TIME: "900" + KEEP_IMAGES: "${KEEP}" + KEEP_CONTAINERS: "${KEEPC}" + KEEP_CONTAINERS_NAMED: "${KEEPCN}" + LOOP: "${LOOP}" + DEBUG: "${DEBUG}" + labels: + io.rancher.scheduler.global: "true" + io.rancher.scheduler.affinity:host_label_ne: "${EXCLUDE_LABEL}" + net: none + privileged: true + tty: false + stdin_open: false + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - /var/lib/docker:/var/lib/docker diff --git a/templates/janitor/4/rancher-compose.yml b/templates/janitor/4/rancher-compose.yml new file mode 100644 index 0000000..8db4a8a --- /dev/null +++ b/templates/janitor/4/rancher-compose.yml @@ -0,0 +1,54 @@ +.catalog: + name: "Janitor" + version: "v1.7.1" + description: "Docker cleanup" + uuid: janitor-3 + questions: + - variable: "FREQUENCY" + label: "Frequency" + description: "Run the cleanup on a cycle of this many seconds" + default: 3600 + required: true + type: "int" + - variable: "EXCLUDE_LABEL" + label: "Exclude label" + description: "Specify a Rancher host label here that will be used to determine on which hosts the Janitor container should not deploy." + default: janitor.exclude=true + required: true + type: "string" + - variable: "KEEP" + label: "Keep images" + description: "A comma separated list of images that should never be removed. These are left-anchored Bash Shell Wildcard patterns." + default: "rancher/" + required: false + type: "string" + - variable: "KEEPC" + label: "Keep containers" + description: "A comma separated list of images that should never have stopped containers removed. These are left-anchored Bash Shell Wildcard patterns." + default: "*:*" + required: false + type: "string" + - variable: "KEEPCN" + label: "Keep named containers" + description: "A comma separated list of names of exited or dead container that should never be removed. These are left-anchored Bash Shell Wildcard patterns." + default: "*-datavolume" + required: false + type: "string" + - variable: "DEBUG" + label: "Enable more debugging output on pattern matches" + description: "Read https://github.com/meltwater/docker-cleanup#environment-variables" + required: true + default: 0 + type: "enum" + options: + - 0 + - 1 + - variable: "LOOP" + label: "Ability to do non-looped cleanups, run it once and exit. Defaults to yes to run it forever in loops." + description: "Read https://github.com/meltwater/docker-cleanup#environment-variables" + required: true + default: true + type: "enum" + options: + - false + - true diff --git a/templates/janitor/config.yml b/templates/janitor/config.yml index 082b015..b128907 100644 --- a/templates/janitor/config.yml +++ b/templates/janitor/config.yml @@ -1,7 +1,7 @@ name: Janitor description: | Automatic cleanup of unused images on hosts, in order to save disk space. -version: v1.7 +version: v1.7.1 category: Monitoring maintainer: Steve Shipway diff --git a/templates/mysql/0/README.md b/templates/mysql/0/README.md new file mode 100644 index 0000000..11e8931 --- /dev/null +++ b/templates/mysql/0/README.md @@ -0,0 +1,18 @@ +# MySQL + +## What is MySQL? + +MySQL is the world's most popular open source database. With its proven performance, reliability and ease-of-use, MySQL has become the leading database choice for web-based applications, covering the entire range from personal projects and websites, via e-commerce and information services, all the way to high profile web properties including Facebook, Twitter, YouTube, Yahoo! and many more. + +For more information and related downloads for MySQL Server and other MySQL products, please visit [www.mysql.com](http://www.mysql.com). + +## Services + +Includes the following services: +- Load Balancer +- MySQL Server +- MySQL Data (sidekick to the server) + +## Usage + +The minimum configuration option(s) required to launch the stack is the MySQL Public LB Port and MySQL Root Password. See the description of each option for more information. diff --git a/templates/mysql/0/docker-compose.yml.tpl b/templates/mysql/0/docker-compose.yml.tpl new file mode 100644 index 0000000..b014999 --- /dev/null +++ b/templates/mysql/0/docker-compose.yml.tpl @@ -0,0 +1,40 @@ +version: '2' +services: + mysql-lb: + image: rancher/lb-service-haproxy:v0.6.4 + ports: + - ${mysql_lb_port}:${mysql_lb_port} + mysql-data: + image: busybox + labels: + io.rancher.container.start_once: true + volumes: + - /var/lib/mysql + mysql: + image: ${mysql_image} + environment: +{{- if eq .Values.mysql_allow_empty_password "yes"}} + MYSQL_ALLOW_EMPTY_PASSWORD: ${mysql_allow_empty_password} +{{- end}} +{{- if (.Values.mysql_database)}} + MYSQL_DATABASE: ${mysql_database} +{{- end}} +{{- if eq .Values.mysql_onetime_password "yes"}} + MYSQL_ONETIME_PASSWORD: ${mysql_onetime_password} +{{- end}} +{{- if (.Values.mysql_password)}} + MYSQL_PASSWORD: ${mysql_password} +{{- end}} +{{- if eq .Values.mysql_random_root_password "yes"}} + MYSQL_RANDOM_ROOT_PASSWORD: ${mysql_random_root_password} +{{- end}} + MYSQL_ROOT_PASSWORD: ${mysql_root_password} +{{- if (.Values.mysql_user)}} + MYSQL_USER: ${mysql_user} +{{- end}} + tty: true + stdin_open: true + labels: + io.rancher.sidekicks: mysql-data + volumes_from: + - mysql-data diff --git a/templates/mysql/0/rancher-compose.yml b/templates/mysql/0/rancher-compose.yml new file mode 100644 index 0000000..f41e4c1 --- /dev/null +++ b/templates/mysql/0/rancher-compose.yml @@ -0,0 +1,124 @@ +.catalog: + name: "mysql" + version: "v0.0.1" + description: "A recommended stack for the MySQL RDBMS." + uuid: mysql-0 + minimum_rancher_version: v1.0.0 + questions: + - variable: mysql_lb_port + description: "Public port for access to MySQL through the load balancer" + label: "MySQL Public LB Port" + required: true + default: 3306 + type: "int" + - variable: mysql_root_password + description: "The password that will be set for the MySQL root superuser account." + label: "MySQL Root Password" + required: true + type: password + - variable: mysql_image + description: "The docker image to use for the MySQL server." + label: "MySQL Docker Image" + type: "enum" + options: + - "mysql:latest" + - "mysql:8.0.1" + - "mysql:8.0" + - "mysql:8" + - "mysql:5.7.18" + - "mysql:5.7" + - "mysql:5" + - "mysql:5.6.36" + - "mysql:5.6" + - "mysql:5.5.56" + - "mysql:5.5" + - "mariadb:latest" + - "mariadb:10.3.0" + - "mariadb:10.3" + - "mariadb:10.2.6" + - "mariadb:10.2" + - "mariadb:10.1.24" + - "mariadb:10.1" + - "mariadb:10" + - "mariadb:10.0.31" + - "mariadb:10.0" + - "mariadb:5.5.56" + - "mariadb:5.5" + - "mariadb:5" + default: "mysql:latest" + required: true + - variable: mysql_database + description: "Optional, allows you to specify the name of a database to be created on image startup." + label: "MySQL Database" + required: false + type: "string" + - variable: mysql_user + description: "Creates an additional MySQL (super)user. MySQL Password must also be set." + label: "MySQL User" + required: false + type: "string" + - variable: mysql_password + description: "A password for the additional MySQL (super)user. MySQL User must also be set." + label: "MySQL Password" + required: false + type: password + - variable: mysql_allow_empty_password + description: "Set to 'yes' to allow the container to be started with a blank password for the root user." + label: MySQL Allow Empty Password + type: "enum" + options: + - "yes" + - "no" + default: "no" + required: false + - variable: mysql_random_root_password + description: "Set to 'yes' to generate a random initial password for the root user (using pwgen)." + label: MySQL Random Root Password + type: "enum" + options: + - "yes" + - "no" + default: "no" + required: false + - variable: mysql_onetime_password + description: "Set to 'yes' and the root user's password will be set as expired once init is complete." + label: MySQL One-time Password + type: "enum" + options: + - "yes" + - "no" + default: "no" + required: false + +version: '2' +services: + mysql-lb: + scale: 1 + start_on_create: true + lb_config: + certs: [] + port_rules: + - protocol: tcp + service: mysql + source_port: ${mysql_lb_port} + target_port: 3306 + health_check: + healthy_threshold: 2 + response_timeout: 2000 + port: 42 + unhealthy_threshold: 3 + interval: 2000 + strategy: recreate + mysql: + scale: 1 + start_on_create: true + health_check: + healthy_threshold: 2 + response_timeout: 2000 + port: 3306 + unhealthy_threshold: 3 + interval: 2000 + strategy: recreate + mysql-data: + scale: 1 + start_on_create: true diff --git a/templates/mysql/README.md b/templates/mysql/README.md new file mode 100644 index 0000000..bc36af5 --- /dev/null +++ b/templates/mysql/README.md @@ -0,0 +1,3 @@ +## What is inside the MySQL Stack? +* MySQL database server + sidekick with volume data +* Load Balancer diff --git a/templates/mysql/catalogIcon-mysql.svg b/templates/mysql/catalogIcon-mysql.svg new file mode 100644 index 0000000..6d1d5c8 --- /dev/null +++ b/templates/mysql/catalogIcon-mysql.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/mysql/config.yml b/templates/mysql/config.yml new file mode 100644 index 0000000..6d2838d --- /dev/null +++ b/templates/mysql/config.yml @@ -0,0 +1,5 @@ +name: MySQL +description: | + MySQL — an open-source relational database management system (RDBMS) +version: v0.0.1 +category: Database diff --git a/templates/rabbitmq-3/2/docker-compose.yml b/templates/rabbitmq-3/2/docker-compose.yml new file mode 100755 index 0000000..efa4e68 --- /dev/null +++ b/templates/rabbitmq-3/2/docker-compose.yml @@ -0,0 +1,42 @@ +version: '2' +services: + rabbitmq: + image: webhostingcoopteam/rabbitmq-conf:0.2.1 + labels: + io.rancher.container.hostname_override: container_name + io.rancher.sidekicks: rabbitmq-base,rabbitmq-datavolume + io.rancher.scheduler.affinity:host_label: ${host_label} + volumes_from: + - rabbitmq-datavolume + environment: + - RABBITMQ_NET_TICKTIME=${net_ticktime} + - RABBITMQ_CLUSTER_PARTITION_HANDLING=${cluster_partition_handling} + - CONFD_ARGS=${confd_args} + rabbitmq-datavolume: + labels: + io.rancher.container.hostname_override: container_name + io.rancher.scheduler.affinity:host_label: ${host_label} + io.rancher.container.start_once: true + volume_driver: ${VOLUME_DRIVER} + volumes: + - rabbitconf:/etc/rabbitmq + - rancherbin:/opt/rancher/bin + entrypoint: /bin/true + image: rabbitmq:3.6-management-alpine + rabbitmq-base: + labels: + io.rancher.container.hostname_override: container_name + io.rancher.scheduler.affinity:host_label: ${host_label} + image: rabbitmq:3.6-management-alpine + restart: always + volumes_from: + - rabbitmq-datavolume + entrypoint: + - /opt/rancher/bin/run.sh + environment: + - RABBITMQ_ERLANG_COOKIE=${erlang_cookie} +volumes: + rancherbin: + driver: ${VOLUME_DRIVER} + rabbitconf: + driver: ${VOLUME_DRIVER} diff --git a/templates/reactioncommerce/0/README.md b/templates/reactioncommerce/0/README.md new file mode 100644 index 0000000..dd9a400 --- /dev/null +++ b/templates/reactioncommerce/0/README.md @@ -0,0 +1,22 @@ +### Docs + +The Reaction Commerce official docs are +[here](https://docs.reactioncommerce.com/) + +This template implements the same method as found +[here](https://docs.reactioncommerce.com/reaction-docs/master/deploying-reaction-using-docker) + +### MongoDB + +You'll need a mongodb stack running, choose it in the external link +question below + +### Traefik + +For external access you'll need to setup [traefik](https://github.com/rancher/community-catalog/tree/master/templates/traefik), all the appropriate +labels will be set when you set the hostname and domain below + +### Support + +There are experimental versions of this template in this catalog [here](https://github.com/ohmydocker/ohmydocker-catalog) which implement +other setups. Issues, PRs, etc are welcome there. diff --git a/templates/reactioncommerce/0/docker-compose.yml.tpl b/templates/reactioncommerce/0/docker-compose.yml.tpl new file mode 100644 index 0000000..4ca7e1f --- /dev/null +++ b/templates/reactioncommerce/0/docker-compose.yml.tpl @@ -0,0 +1,40 @@ +version: '2' +services: + reaction: + image: reactioncommerce/reaction:v1.4.0 + restart: always + labels: + io.rancher.scheduler.affinity:host_label: ${host_label} + traefik.enable: true + traefik.alias: ${REACTION_HOST} + traefik.domain: ${REACTION_DOMAIN} + traefik.acme: true + traefik.port: 3000 + environment: + MONGO_URL: "mongodb://mongo/${MONGO_DB}" + ROOT_URL: "http://${REACTION_HOST}.${REACTION_DOMAIN}" + REACTION_EMAIL: ${REACTION_EMAIL} + REACTION_USER: ${REACTION_USER} + REACTION_AUTH: ${REACTION_AUTH} +{{- if ne .Values.mongo_link ""}} + external_links: + - ${mongo_link}:mongo + tty: true +{{- else}} + mongo: + command: mongod --storageEngine=wiredTiger + restart: always + environment: + MONGO_SERVICE_NAME: mongo + CATTLE_SCRIPT_DEBUG: ${debug} + tty: true + image: mongo:3.4 + labels: + io.rancher.scheduler.affinity:host_label: ${host_label} + io.rancher.container.hostname_override: container_name + volumes: + - mongodata:/data/db +volumes: + mongodata: + driver: ${VOLUME_DRIVER} +{{- end}} diff --git a/templates/reactioncommerce/0/rancher-compose.yml b/templates/reactioncommerce/0/rancher-compose.yml new file mode 100644 index 0000000..e295a7a --- /dev/null +++ b/templates/reactioncommerce/0/rancher-compose.yml @@ -0,0 +1,70 @@ +version: '2' +catalog: + name: "reactiondemo" + version: 1.4.0-rancher1 + description: "E-commerce powered by reaction" + uuid: reaction-0 + minimum_rancher_version: v0.51.0 + questions: + - variable: "REACTION_HOST" + description: "Hostname to use for the reaction server" + label: "reaction Hostname" + required: true + default: "reaction" + type: "string" + - variable: "REACTION_DOMAIN" + description: "Domain to use for the reaction server" + label: "reaction Domain" + required: true + default: "local" + type: "string" + - variable: host_label + label: "Host Label to reaction Tags" + description: | + Host label to use as reaction 'value' tag. + Example: 'reaction=true' + required: false + default: "private=true" + type: "string" + - variable: REACTION_EMAIL + label: "reaction Email" + required: true + default: "test@local" + type: "string" + - variable: REACTION_USER + label: "reaction User" + required: true + default: "" + type: "string" + - variable: REACTION_AUTH + label: "reaction Auth" + required: true + default: "" + type: "password" + - variable: "mongo_link" + description: | + MongoDB external service link + cluster. + label: "External stack/service" + default: "" + required: false + type: "service" + - variable: "MONGO_DB" + default: "reaction" + description: "The mongodb name to associate with this server." + label: "mongo_db" + required: true + type: "string" + +services: + reaction: + scale: 1 + retain_ip: true + health_check: + healthy_threshold: 2 + response_timeout: 5000 + port: 3000 + unhealthy_threshold: 3 + interval: 5000 + strategy: recreate + request_line: GET / # HTTP/1.0 diff --git a/templates/reactioncommerce/README.md b/templates/reactioncommerce/README.md new file mode 100644 index 0000000..675e427 --- /dev/null +++ b/templates/reactioncommerce/README.md @@ -0,0 +1 @@ +#[ReactionCommerce](http://reactioncommerce.com/) diff --git a/templates/reactioncommerce/catalogIcon-reactioncommerce.png b/templates/reactioncommerce/catalogIcon-reactioncommerce.png new file mode 100644 index 0000000..bd5e651 Binary files /dev/null and b/templates/reactioncommerce/catalogIcon-reactioncommerce.png differ diff --git a/templates/reactioncommerce/config.yml b/templates/reactioncommerce/config.yml new file mode 100644 index 0000000..7719f54 --- /dev/null +++ b/templates/reactioncommerce/config.yml @@ -0,0 +1,5 @@ +name: Reaction Commerce +description: | + E-commerce powered by Reaction +version: 1.4.0-rancher1 +category: Repository diff --git a/templates/sentry/2/README.md b/templates/sentry/2/README.md new file mode 100644 index 0000000..c35b928 --- /dev/null +++ b/templates/sentry/2/README.md @@ -0,0 +1,20 @@ +# Sentry + + +### Info: + This templates creates a complete [sentry](https://github.com/getsentry/sentry) setup including postgres and redis servers. + + Images are the offical images from: + * Sentry: [https://hub.docker.com/_/sentry/](https://hub.docker.com/_/sentry/) + * Postgres: [https://hub.docker.com/_/postgres/](https://hub.docker.com/_/postgres/) + * Redis: [https://hub.docker.com/_/redis/](https://hub.docker.com/_/redis/) + +### Usage: + + * Select Sentry from catalog. + + * Required: Enter a sentry secret + + * Optional: Email configuration + + * Click deploy. diff --git a/templates/sentry/2/docker-compose.yml b/templates/sentry/2/docker-compose.yml new file mode 100644 index 0000000..02fd700 --- /dev/null +++ b/templates/sentry/2/docker-compose.yml @@ -0,0 +1,114 @@ +sentry-postgres: + environment: + POSTGRES_DB: ${sentry_db_name} + POSTGRES_USER: ${sentry_db_user} + POSTGRES_PASSWORD: ${sentry_db_pass} + PGDATA: /data/postgres/data + log_driver: '' + labels: + io.rancher.sidekicks: sentry-postgres-datavolume + io.rancher.container.hostname_override: container_name + volumes_from: + - sentry-postgres-datavolume + tty: true + log_opt: {} + image: postgres:9.6-alpine + stdin_open: true +sentry-postgres-datavolume: + image: alpine + stdin_open: true + net: none + entrypoint: + - /bin/true + volumes: + - /data/postgres/data + tty: true + labels: + io.rancher.container.start_once: 'true' +sentry-cron: + environment: + SENTRY_EMAIL_HOST: ${sentry_email_host} + SENTRY_EMAIL_PASSWORD: ${sentry_email_password} + SENTRY_EMAIL_PORT: '${sentry_email_port}' + SENTRY_EMAIL_USER: ${sentry_email_user} + SENTRY_SECRET_KEY: ${sentry_secret_key} + SENTRY_SERVER_EMAIL: ${sentry_server_email} + SENTRY_POSTGRES_HOST: postgres + SENTRY_DB_NAME: ${sentry_db_name} + SENTRY_DB_USER: ${sentry_db_user} + SENTRY_DB_PASSWORD: ${sentry_db_pass} + log_driver: '' + labels: + io.rancher.container.hostname_override: container_name + tty: true + command: + - run + - cron + log_opt: {} + image: sentry:8.18.0 + links: + - sentry-postgres:postgres + - sentry-redis:redis + stdin_open: true +sentry-redis: + log_driver: '' + labels: + io.rancher.container.hostname_override: container_name + tty: true + log_opt: {} + image: redis:3.2-alpine + stdin_open: true +sentry: + ports: + - ${sentry_public_port}:9000/tcp + environment: + SENTRY_EMAIL_HOST: ${sentry_email_host} + SENTRY_EMAIL_PASSWORD: ${sentry_email_password} + SENTRY_EMAIL_PORT: '${sentry_email_port}' + SENTRY_EMAIL_USER: ${sentry_email_user} + SENTRY_SECRET_KEY: ${sentry_secret_key} + SENTRY_SERVER_EMAIL: ${sentry_server_email} + SENTRY_POSTGRES_HOST: postgres + SENTRY_DB_NAME: ${sentry_db_name} + SENTRY_DB_USER: ${sentry_db_user} + SENTRY_DB_PASSWORD: ${sentry_db_pass} + log_driver: '' + labels: + io.rancher.container.hostname_override: container_name + tty: true + command: + - /bin/bash + - -c + - sentry upgrade --noinput && sentry createuser --email ${sentry_initial_user_email} --password ${sentry_initial_user_password} --superuser && /entrypoint.sh run web || /entrypoint.sh run web + log_opt: {} + image: sentry:8.18.0 + links: + - sentry-postgres:postgres + - sentry-redis:redis + stdin_open: true +sentry-worker: + environment: + SENTRY_EMAIL_HOST: ${sentry_email_host} + SENTRY_EMAIL_PASSWORD: ${sentry_email_password} + SENTRY_EMAIL_PORT: '${sentry_email_port}' + SENTRY_EMAIL_USER: ${sentry_email_user} + SENTRY_SECRET_KEY: ${sentry_secret_key} + SENTRY_SERVER_EMAIL: ${sentry_server_email} + SENTRY_POSTGRES_HOST: postgres + SENTRY_DB_NAME: ${sentry_db_name} + SENTRY_DB_USER: ${sentry_db_user} + SENTRY_DB_PASSWORD: ${sentry_db_pass} + log_driver: '' + labels: + io.rancher.scheduler.global: 'true' + io.rancher.container.hostname_override: container_name + tty: true + command: + - run + - worker + log_opt: {} + image: sentry:8.18.0 + links: + - sentry-postgres:postgres + - sentry-redis:redis + stdin_open: true diff --git a/templates/sentry/2/rancher-compose.yml b/templates/sentry/2/rancher-compose.yml new file mode 100644 index 0000000..9631c30 --- /dev/null +++ b/templates/sentry/2/rancher-compose.yml @@ -0,0 +1,129 @@ +version: '2' +catalog: + name: Sentry + version: 8.18.0 + description: Sentry is a realtime event logging and aggregation platform + + questions: + - variable: "sentry_secret_key" + type: "password" + required: true + label: "SENTRY_SECRET_KEY" + description: "A secret key used for cryptographic functions within Sentry. see https://hub.docker.com/_/sentry/ for more info" + + - variable: "sentry_public_port" + type: "int" + required: true + label: "Sentry public port" + default: 9000 + description: "Port that Sentry will listen on. Alternatively you could point a load balancer to the port 9000 of this container" + + - variable: "sentry_db_name" + type: "string" + required: true + label: "Sentry db name" + default: "sentry" + description: "Sentry db name." + + - variable: "sentry_db_user" + type: "string" + required: true + label: "Sentry db user" + default: "sentry" + description: "Sentry db user." + + - variable: "sentry_db_pass" + type: "string" + required: true + label: "Sentry db pass" + default: "sentry" + description: "Sentry db pass." + + - variable: "sentry_initial_user_email" + type: "string" + required: true + label: "SENTRY_INITIAL_USER_EMAIL" + description: "The initial superuser email" + + - variable: "sentry_initial_user_password" + type: "password" + required: true + label: "SENTRY_INITIAL_USER_PASSWORD" + description: "The initial superuser password. Please use a simple initial password and change it afterwards in the Sentry interface" + + - variable: "sentry_server_email" + type: "string" + required: false + label: "SENTRY_SERVER_EMAIL" + description: "The email address used for 'From:'. see https://hub.docker.com/_/sentry/ for more info" + + - variable: "sentry_email_host" + type: "string" + required: false + label: "SENTRY_EMAIL_HOST" + description: "The smtp server address. see https://hub.docker.com/_/sentry/ for more info" + + - variable: "sentry_email_user" + type: "string" + required: false + label: "SENTRY_EMAIL_USER" + description: "The username for the email account. see https://hub.docker.com/_/sentry/ for more info" + + - variable: "sentry_email_password" + type: "password" + required: false + label: "SENTRY_EMAIL_PASSWORD" + description: "The password for the email account. see https://hub.docker.com/_/sentry/ for more info" + + - variable: "sentry_email_port" + type: "int" + required: false + label: "SENTRY_EMAIL_PORT" + description: "Port of the smtp server. see https://hub.docker.com/_/sentry/ for more info" + +services: + sentry-cron: + scale: 1 + start_on_create: true + sentry-postgres-datavolume: + scale: 1 + start_on_create: true + sentry-worker: + start_on_create: true + sentry-redis: + scale: 1 + start_on_create: true + health_check: + response_timeout: 2000 + healthy_threshold: 2 + port: 6379 + unhealthy_threshold: 3 + initializing_timeout: 60000 + interval: 2000 + strategy: recreate + reinitializing_timeout: 60000 + sentry-postgres: + scale: 1 + start_on_create: true + health_check: + response_timeout: 2000 + healthy_threshold: 2 + port: 5432 + unhealthy_threshold: 3 + initializing_timeout: 60000 + interval: 2000 + strategy: recreate + reinitializing_timeout: 60000 + sentry: + scale: 1 + start_on_create: true + health_check: + response_timeout: 2000 + healthy_threshold: 2 + port: 9000 + unhealthy_threshold: 3 + initializing_timeout: 600000 + interval: 2000 + strategy: recreate + request_line: GET "/auth/login/sentry" "HTTP/1.0" + reinitializing_timeout: 60000 diff --git a/templates/sentry/config.yml b/templates/sentry/config.yml index c1a9ea1..76276bb 100644 --- a/templates/sentry/config.yml +++ b/templates/sentry/config.yml @@ -1,4 +1,4 @@ name: Sentry -version: 8.17.0 +version: 8.18.0 description: Sentry is a realtime event logging and aggregation platform category: Error Tracking diff --git a/templates/traefik/8/README.md b/templates/traefik/8/README.md new file mode 100644 index 0000000..11bae29 --- /dev/null +++ b/templates/traefik/8/README.md @@ -0,0 +1,79 @@ +# Traefik active load balancer (Experimental) + +### Info: + + This template deploys traefik active load balancers on top of Rancher. The configuration is generated and updated with confd from Rancher metadata. + It would be deployed in hosts with label traefik_lb=true. + +### Config: + +- host_label = "traefik_lb=true" # Host label where to run traefik service. +- http_port = 8080 # Port exposed to get access to the published services. +- https_port = 8443 # Port exposed to get secured access to the published services. +- admin_port = 8000 # Port exposed to get admin access to the traefik service. +- https_enable = + - false: Enable http enpoints and disable https ones. + - true: Enable http and https endpoints. + - only: Enable https endpoints and redirect http to https. +- acme_enable = false # Enable/Disable acme traefik support. +- acme_email = "test@traefik.io" # acme user email +- acme_ondemand = true # acme ondemand parameter. +- acme_onhostrule = true # acme onHostRule parameter. +- ssl_key # Paste your ssl key. *Required if you enable https +- ssl_crt # Paste your ssl crt. *Required if you enable https +- insecure_skip = false # Enable InsecureSkipVerify param. +- refresh_interval = 10s # Interval to refresh traefik rules.toml from rancher-metadata. + +NOTE: If you enable acme support, additional sidekick will be created for acme persistance. + +### Service configuration labels: + +Traefik labels has to be added in your services, in order to get included in traefik dynamic config. + +- traefik.enable = + - true: the service will be published as *service_name.stack_name.traefik_domain* + - stack: the service will be published as *stack_name.traefik_domain*. WARNING: You could have collisions inside services within your stack + - false: the service will not be published +- traefik.priority = # Override for frontend priority. 5 by default +- traefik.protocol = < http | https > # Override the default http protocol +- traefik.sticky = < true | false > # Enable/disable sticky sessions to the backend +- traefik.alias = < alias > # Alternate names to route rule. Multiple values separated by ",". traefik.domain is appended. WARNING: You could have collisions BE CAREFULL +- traefik.alias.fqdn = < alias fqdn > # Alternate names to route rule. Multiple values separated by ",". traefik.domain must be defined but is not appended here. +- traefik.domain = < domain.name > # Domain names to route rules. Multiple domains separated by "," +- traefik.domain.regexp = < domain.regexp > # Domain name regexp rule. Multiple domains separated by "," +- traefik.port = < port > # Port to expose throught traefik +- traefik.acme = < true | false > # Enable/disable ACME traefik feature +- traefik.path = < path > # Path rule. Multiple values separated by "," +- traefik.path.strip = < path > # Path strip rule. Multiple values separated by "," +- traefik.path.prefix = < path > # Path prefix rule. Multiple values separated by "," +- traefik.path.prefix.strip = < path > # Path prefix strip rule. Multiple values separated by "," + +Details for configuring the traefik rules can be found at: https://docs.traefik.io/basics/#frontends + +WARNING: Only services with healthy state are added to traefik, so health checks are mandatory. + +### Usage: + + Select Traefik from catalog. + + Set the params. + + Click deploy. + + Services will be accessed throught hosts ip's whith $host_label: + + - http://${service_name}.${stack_name}.${traefik.domain}:${http_port} + - https://${service_name}.${stack_name}.${traefik.domain}:${https_port} + + or + + - http://${stack_name}.${traefik.domain}:${http_port} + - https://${stack_name}.${traefik.domain}:${https_port} + + If you set traefik.alias you service could also be acceses through + + - http://${traefik.alias}.${traefik.domain}:${http_port} + - https://${traefik.alias}.${traefik.domain}:${https_port} + +Note: To access the services, you need to create A or CNAMES dns entries for every one. + diff --git a/templates/traefik/8/docker-compose.yml.tpl b/templates/traefik/8/docker-compose.yml.tpl new file mode 100644 index 0000000..aad902e --- /dev/null +++ b/templates/traefik/8/docker-compose.yml.tpl @@ -0,0 +1,64 @@ +traefik: + ports: + - ${admin_port}:8000/tcp + - ${http_port}:${http_port}/tcp + - ${https_port}:${https_port}/tcp + log_driver: '' + labels: + io.rancher.scheduler.global: 'true' + io.rancher.scheduler.affinity:host_label: ${host_label} + io.rancher.scheduler.affinity:container_label_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + io.rancher.sidekicks: traefik-conf + {{- if eq .Values.acme_enable "true" -}} + ,traefik-acme + {{- end}} + io.rancher.container.hostname_override: container_name + tty: true + log_opt: {} + image: rawmind/alpine-traefik:1.3.3 + environment: + - CONF_INTERVAL=${refresh_interval} + - TRAEFIK_HTTP_PORT=${http_port} + - TRAEFIK_HTTPS_PORT=${https_port} + - TRAEFIK_HTTPS_ENABLE=${https_enable} +{{- if eq .Values.acme_enable "true"}} + - TRAEFIK_ACME_ENABLE=${acme_enable} + - TRAEFIK_ACME_EMAIL=${acme_email} + - TRAEFIK_ACME_ONDEMAND=${acme_ondemand} + - TRAEFIK_ACME_ONHOSTRULE=${acme_onhostrule} +{{- end}} + - TRAEFIK_INSECURE_SKIP=${insecure_skip} + volumes_from: + - traefik-conf +{{- if eq .Values.acme_enable "true"}} + - traefik-acme +{{- end}} +traefik-conf: + log_driver: '' + labels: + io.rancher.scheduler.global: 'true' + io.rancher.scheduler.affinity:host_label: ${host_label} + io.rancher.scheduler.affinity:container_label_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + io.rancher.container.start_once: 'true' + tty: true + log_opt: {} + image: rawmind/rancher-traefik:1.3.3 + net: none + volumes: + - /opt/tools +{{- if eq .Values.acme_enable "true"}} +traefik-acme: + net: none + labels: + io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + io.rancher.container.hostname_override: container_name + io.rancher.container.start_once: true + environment: + - SERVICE_UID=10001 + - SERVICE_GID=10001 + - SERVICE_VOLUME=/opt/traefik/acme + volumes: + - ${VOLUME_NAME}:/opt/traefik/acme + volume_driver: ${VOLUME_DRIVER} + image: rawmind/alpine-volume:0.0.2-1 +{{- end}} diff --git a/templates/traefik/8/rancher-compose.yml b/templates/traefik/8/rancher-compose.yml new file mode 100644 index 0000000..49af3aa --- /dev/null +++ b/templates/traefik/8/rancher-compose.yml @@ -0,0 +1,123 @@ +.catalog: + name: traefik + version: v1.3.3-rancher2 + description: | + (Experimental) Traefik load balancer. + minimum_rancher_version: v0.59.0 + maintainer: "Raul Sanchez " + uuid: traefik-0 + questions: + - variable: "host_label" + description: "Host label where to run traefik service." + label: "Host label:" + required: true + default: "traefik_lb=true" + type: "string" + - variable: "http_port" + description: "Traefik http public port to listen." + label: "Http port:" + required: true + default: 8080 + type: "int" + - variable: "https_port" + description: "Traefik https public port to listen." + label: "Https port:" + required: true + default: 8443 + type: "int" + - variable: "admin_port" + description: "Traefik admin public port to listen." + label: "Admin port:" + required: true + default: 8000 + type: "int" + - variable: "https_enable" + label: "Enable HTTPS:" + description: | + Enable https working mode. If you activate, you need to fill SSL key and SSL crt in order to work. + default: false + required: true + type: enum + options: + - false + - true + - only + - variable: "acme_enable" + description: "Enable acme support on traefik." + label: "Enable ACME:" + required: true + default: false + type: "boolean" + - variable: "acme_email" + description: "ACME user email." + label: "ACME email:" + required: true + default: "test@traefik.io" + type: "string" + - variable: "acme_ondemand" + description: "Enable acme ondemand." + label: "ACME ondemand:" + required: true + default: true + type: "boolean" + - variable: "acme_onhostrule" + description: "Enable acme onHostRule." + label: "ACME onHostRule:" + required: true + default: true + type: "boolean" + - variable: "ssl_key" + description: "SSL key to secure the service. *Required if you enable https" + label: "SSL key" + type: "multiline" + required: false + default: "" + - variable: "ssl_crt" + description: "SSL cert to secure the service. *Required if you enable https" + label: "SSL crt" + type: "multiline" + required: false + default: "" + - variable: "insecure_skip" + description: "Enable InsecureSkipVerify param." + label: "InsecureSkipVerify:" + required: true + default: false + type: "boolean" + - variable: "refresh_interval" + description: "Interval to poll/apply configuration changes." + label: "Refresh Interval (s):" + required: true + default: 10 + type: "int" + - variable: "VOLUME_DRIVER" + description: "The VOLUME driver to associate with this server" + label: "VOLUME Driver" + required: true + default: "rancher-nfs" + type: enum + options: # List of options if using type of `enum` + - rancher-nfs + - rancher-efs + - rancher-ebs + - variable: "VOLUME_NAME" + description: "The VOLUME name to associate with this server" + label: "VOLUME Name" + required: true + default: "TRAEFIK" + type: "string" +traefik: + retain_ip: true + health_check: + port: 8000 + interval: 5000 + unhealthy_threshold: 3 + request_line: 'GET /dashboard/# HTTP/1.0' + healthy_threshold: 2 + response_timeout: 5000 + metadata: + traefik: + ssl_key: | + ${ssl_key} + ssl_crt: | + ${ssl_crt} diff --git a/templates/traefik/config.yml b/templates/traefik/config.yml index 131b31c..5aa689f 100644 --- a/templates/traefik/config.yml +++ b/templates/traefik/config.yml @@ -1,9 +1,9 @@ name: Traefik description: | (Experimental) Traefik active load balancer -version: v1.3.3-rancher1 +version: v1.3.3-rancher2 category: Load Balancing maintainer: "Raul Sanchez " minimum_rancher_version: v0.59.0 -license: +license: projectURL: https://github.com/rawmind0/alpine-traefik diff --git a/templates/wordpress/1/docker-compose.yml b/templates/wordpress/1/docker-compose.yml new file mode 100644 index 0000000..9021b8d --- /dev/null +++ b/templates/wordpress/1/docker-compose.yml @@ -0,0 +1,32 @@ +version: '2' +services: + mariadb: + image: 'bitnami/mariadb:10.1' + volumes: + - 'mariadb_data:/bitnami' + environment: + - MARIADB_ROOT_PASSWORD=${mariadb_root_password} + - MARIADB_USER=${mariadb_user} + - MARIADB_PASSWORD=${mariadb_user_password} + - MARIADB_DATABASE=${mariadb_database_name} + wordpress: + image: 'bitnami/wordpress:4' + volumes: + - 'wordpress_data:/bitnami' + depends_on: + - mariadb + environment: + - WORDPRESS_DATABASE_NAME=${mariadb_database_name} + - WORDPRESS_DATABASE_USER=${mariadb_user} + - WORDPRESS_DATABASE_PASSWORD=${mariadb_user_password} + - WORDPRESS_USERNAME=${wordpress_username} + - WORDPRESS_PASSWORD=${wordpress_password} + wordpress-lb: + image: rancher/lb-service-haproxy:v0.7.5 + ports: + - ${public_port}:${public_port} +volumes: + mariadb_data: + driver: ${volume_driver} + wordpress_data: + driver: ${volume_driver} \ No newline at end of file diff --git a/templates/wordpress/1/rancher-compose.yml b/templates/wordpress/1/rancher-compose.yml new file mode 100644 index 0000000..a23a105 --- /dev/null +++ b/templates/wordpress/1/rancher-compose.yml @@ -0,0 +1,86 @@ +version: '2' +catalog: + name: "Wordpress" + version: "v0.2-bitnami" + description: "Blog tool, publishing platform and CMS based on bitnami images" + uuid: Wordpress-1 + minimum_rancher_version: v0.51.0 + questions: + - variable: public_port + description: "public port to access the wordpress site" + label: "Public Port" + required: true + default: "80" + type: "int" + - variable: mariadb_root_password + description: "MariaDB root password, set on first run" + label: "MariaDB Root Password" + required: true + default: "mariadb_my_root" + type: "string" + - variable: mariadb_user + description: "MariaDB database user, created on first run" + label: "MariaDB Database User" + required: true + default: "wordpress_user" + type: "string" + - variable: mariadb_user_password + description: "MariaDB database user password, set on first run" + label: "MariaDB Database User Password" + required: true + default: "wordpress_password" + type: "string" + - variable: mariadb_database_name + description: "Wordpress database name" + label: "Wordpress database name" + required: true + default: "bitnami_wordpress" + type: "string" + - variable: wordpress_username + description: "WordPress application username" + label: "WordPress application username" + required: true + default: "admin" + type: "string" + - variable: wordpress_password + description: "WordPress application password" + label: "WordPress application password" + required: true + default: "bitnami" + type: "string" + - variable: volume_driver + description: "Volume driver to use with this service" + label: "Volume driver" + required: true + default: "local" + type: enum + options: + - local + - rancher-nfs + - rancher-efs + - rancher-ebs +services: + wordpress-lb: + scale: 1 + lb_config: + certs: [] + port_rules: + - protocol: http + service: wordpress + source_port: ${public_port} + target_port: 80 + health_check: + response_timeout: 2000 + healthy_threshold: 2 + port: 42 + unhealthy_threshold: 3 + wordpress: + scale: 1 + retain_ip: true + health_check: + port: 80 + interval: 5000 + unhealthy_threshold: 3 + request_line: 'GET / HTTP/1.0' + healthy_threshold: 2 + response_timeout: 5000 \ No newline at end of file diff --git a/templates/wordpress/README.md b/templates/wordpress/README.md new file mode 100644 index 0000000..4de1c01 --- /dev/null +++ b/templates/wordpress/README.md @@ -0,0 +1,12 @@ +## What is inside WordPress Stack? +* MariaDB Database +* WordPress (php/apache) +* Rancher Load Balancer (haproxy) + +## Info +* To persist website and database data, two volumes are created: mariadb_data, wordpress_data. +* You can choose from one of existing rancher volume types depending on your own environment. + +## Compatibility Notes + +* Version v0.2-bitnami has some known [issue](https://github.com/bitnami/bitnami-docker-testlink/issues/17#issuecomment-261783035) with Docker overlay and overlay2 storage driver. Please try to switch to aufs or devicemapper. diff --git a/templates/wordpress/config.yml b/templates/wordpress/config.yml index 5f43d8b..eb08385 100644 --- a/templates/wordpress/config.yml +++ b/templates/wordpress/config.yml @@ -1,5 +1,5 @@ name: Wordpress description: | Blog tool, publishing platform and CMS -version: v0.1-educaas1 +version: v0.2-bitnami category: Blogging diff --git a/templates/zookeeper/3/README.md b/templates/zookeeper/3/README.md new file mode 100644 index 0000000..ee2b770 --- /dev/null +++ b/templates/zookeeper/3/README.md @@ -0,0 +1,27 @@ +# Apache Zookeeper (Experimental) + +### Info: + + This template creates, scale in and scale out a multinodes zk (zookeeper) cluster on top of Rancher. The configuration is generated with confd from Rancher metadata. + Cluster size are variable after deployment, and get reconfigured if refresh interval > 0. + + +### Usage: + + Select Apache Zookeeper from catalog. + + Enter the number of nodes, mem and refresh interval for the zk cluster. (set refresh data to 0 to disable dinamic config) + + Change the following zookeeper default parameters, if you need: + +- ZK_DATA_DIR="/opt/zk/data" +- ZK_INIT_LIMIT="10" +- ZK_MAX_CLIENT_CXNS="500" +- ZK_SYNC_LIMIT="5" +- ZK_TICK_TIME="2000" + + Click deploy. + + Zookeeper can now be accessed over the Rancher network. + + Note: When you scale the cluster, zero downtime is expected... diff --git a/templates/zookeeper/3/docker-compose.yml.tpl b/templates/zookeeper/3/docker-compose.yml.tpl new file mode 100644 index 0000000..a6c73dc --- /dev/null +++ b/templates/zookeeper/3/docker-compose.yml.tpl @@ -0,0 +1,55 @@ +version: '2' +services: + zk: + tty: true + image: rawmind/alpine-zk:3.4.9-3 + volumes_from: + - zk-volume + - zk-conf + environment: + - JVMFLAGS=-Xmx${zk_mem}m -Xms${zk_mem}m + - ZK_DATA_DIR=${zk_data_dir} + - ZK_INIT_LIMIT=${zk_init_limit} + - ZK_MAX_CLIENT_CXNS=${zk_max_client_cxns} + - ZK_SYNC_LIMIT=${zk_sync_limit} + - ZK_TICK_TIME=${zk_tick_time} + labels: + io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + io.rancher.container.hostname_override: container_name +{{- if ne .Values.host_label ""}} + io.rancher.scheduler.affinity:host_label: ${host_label} +{{- end}} + io.rancher.sidekicks: zk-volume, zk-conf + zk-conf: + labels: + io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + io.rancher.container.hostname_override: container_name +{{- if ne .Values.host_label ""}} + io.rancher.scheduler.affinity:host_label: ${host_label} +{{- end}} + io.rancher.container.start_once: true + image: rawmind/rancher-zk:3.4.9 + volumes: + - zkconfig:/opt/tools + zk-volume: + labels: + io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + io.rancher.container.hostname_override: container_name +{{- if ne .Values.host_label ""}} + io.rancher.scheduler.affinity:host_label: ${host_label} +{{- end}} + io.rancher.container.start_once: true + environment: + - SERVICE_UID=10002 + - SERVICE_GID=10002 + - SERVICE_VOLUME=${zk_data_dir} + volumes: + - zkdata:${zk_data_dir} + image: rawmind/alpine-volume:0.0.2-1 +volumes: + zkconfig: + driver: ${VOLUME_DRIVER} + per_container: true + zkdata: + driver: ${VOLUME_DRIVER} + per_container: true diff --git a/templates/zookeeper/3/rancher-compose.yml b/templates/zookeeper/3/rancher-compose.yml new file mode 100644 index 0000000..15751d9 --- /dev/null +++ b/templates/zookeeper/3/rancher-compose.yml @@ -0,0 +1,88 @@ +version: '2' +catalog: + name: Zookeeper + version: 3.4.9-rancher2 + description: | + (Experimental) Apache Zookeeper cluster. + minimum_rancher_version: v0.59.0 + maintainer: "Raul Sanchez " + uuid: zk-0 + questions: + - variable: "zk_scale" + description: "Number of zk nodes. Note: Recommended an odd number" + label: "Zk Nodes:" + required: true + default: 3 + type: "int" + - variable: "zk_mem" + description: "Amount of memory to config zk." + label: "Zk Memory (mb):" + required: true + default: 512 + type: "int" + - variable: "zk_init_limit" + description: "Time to allow followers to connect and sync with leader" + label: "Zk init limit (ticks):" + required: true + default: 10 + type: "int" + - variable: "zk_data_dir" + description: "Directory where zookeeper store data" + label: "Zk data dir:" + required: true + default: "/opt/zk/data" + type: "string" + - variable: "zk_max_client_cxns" + description: "Max client concurrent connections" + label: "Zk max client cxns:" + required: true + default: 500 + type: "int" + - variable: "zk_sync_limit" + description: "Time to allow followers to sync with leader" + label: "Zk sync limit (ticks):" + required: true + default: 5 + type: "int" + - variable: "zk_tick_time" + description: "Tick time length" + label: "Zk tick time (ms):" + required: true + default: 2000 + type: "int" + - variable: "zk_interval" + description: "Interval to poll/apply configuration changes. 0 to disable, reconfiguration will be done when you restart zk nodes" + label: "Zk Interval (s):" + required: true + default: 60 + type: "int" + - variable: host_label + label: "Host with Label to put zookeeper on" + description: | + Host label to use as zookeeper 'value' tag. + Example: 'zookeeper=true' + required: false + default: "" + type: "string" + - variable: "VOLUME_DRIVER" + description: "The VOLUME driver to associate with this server" + label: "VOLUME Driver" + required: true + default: "local" + type: enum + options: # List of options if using type of `enum` + - local + - rancher-nfs + - rancher-efs + - rancher-ebs +services: + zk: + scale: ${zk_scale} + retain_ip: true + health_check: + port: 2181 + interval: 5000 + unhealthy_threshold: 3 + request_line: '' + healthy_threshold: 2 + response_timeout: 5000 diff --git a/templates/zookeeper/config.yml b/templates/zookeeper/config.yml index 84ea903..d6b7d77 100644 --- a/templates/zookeeper/config.yml +++ b/templates/zookeeper/config.yml @@ -1,7 +1,7 @@ name: Apache Zookeeper description: | (Experimental) Zookeeper cluster -version: 3.4.9-rancher1 +version: 3.4.9-rancher2 category: Clustering maintainer: "Raul Sanchez " projectURL: https://github.com/rawmind0/alpine-zk