diff --git a/templates/traefik/0/README.md b/templates/traefik/0/README.md new file mode 100644 index 0000000..add63bd --- /dev/null +++ b/templates/traefik/0/README.md @@ -0,0 +1,32 @@ +# 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: + +- http_port = 8080 # Port exposed to get access to the published services. +- admin_port = 8000 # Port exposed to get admin access to the traefik service. +- refresh_interval = 60s # Interval to refresh traefik rules.toml from rancher-metadata. + +### Service configuration labels: + +Traefik labels has to be added in your services, in order to get included in traefik dynamic config. + +- traefik.enable = +- traefik.domain = < domainname to route rule > +- traefik.port = < port to expose throught traefik > + + +### Usage: + + Select Traefik from catalog. + + Enter the http_port, admin_port and refresh_interval. + + Click deploy. + + Services will be accessed throught hosts whith traefik_lb=true at http://${service_name}.${service_name}.${traefik.domain}:${http_port} + diff --git a/templates/traefik/0/docker-compose.yml b/templates/traefik/0/docker-compose.yml new file mode 100644 index 0000000..6cb1550 --- /dev/null +++ b/templates/traefik/0/docker-compose.yml @@ -0,0 +1,31 @@ +traefik: + ports: + - ${admin_port}:${admin_port}/tcp + - ${http_port}:${http_port}/tcp + log_driver: '' + labels: + io.rancher.scheduler.global: 'true' + io.rancher.scheduler.affinity:host_label: traefik_lb=true + io.rancher.scheduler.affinity:container_label_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + io.rancher.sidekicks: traefik-conf + io.rancher.container.hostname_override: container_name + tty: true + log_opt: {} + image: rawmind/alpine-traefik:1.0.0-beta.555-6 + environment: + - TRAEFIK_HTTP_PORT=${http_port} + - TRAEFIK_ADMIN_PORT=${admin_port} + - CONF_INTERVAL=${refresh_interval} + volumes_from: + - traefik-conf +traefik-conf: + log_driver: '' + labels: + io.rancher.scheduler.global: 'true' + io.rancher.scheduler.affinity:host_label: traefik_lb=true + 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:0.0.1-10 + net: none diff --git a/templates/traefik/0/rancher-compose.yml b/templates/traefik/0/rancher-compose.yml new file mode 100644 index 0000000..4d23846 --- /dev/null +++ b/templates/traefik/0/rancher-compose.yml @@ -0,0 +1,36 @@ +.catalog: + name: Traefik + version: v1.0.0-beta.555-rancher1 + description: | + (Experimental) Traefik active load balancer. + minimum_rancher_version: v0.59.0 + maintainer: "Raul Sanchez " + uuid: traefik-0 + questions: + - variable: "http_port" + description: "Traefik http public port to listen." + label: "Http port:" + required: true + default: 8080 + type: "int" + - variable: "admin_port" + description: "Traefik admin public port to listen." + label: "Admin port:" + required: true + default: 8000 + type: "string" + - variable: "refresh_interval" + description: "Interval to poll/apply configuration changes." + label: "Refresh Interval (s):" + required: true + default: 60 + type: "int" +traefik: + retain_ip: true + health_check: + port: ${admin_port} + interval: 5000 + unhealthy_threshold: 3 + request_line: 'GET /dashboard/# HTTP/1.0' + healthy_threshold: 2 + response_timeout: 5000 diff --git a/templates/traefik/catalogIcon-Traefik.svg b/templates/traefik/catalogIcon-Traefik.svg new file mode 100644 index 0000000..8ee3448 --- /dev/null +++ b/templates/traefik/catalogIcon-Traefik.svg @@ -0,0 +1,342 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/templates/traefik/config.yml b/templates/traefik/config.yml new file mode 100644 index 0000000..3617525 --- /dev/null +++ b/templates/traefik/config.yml @@ -0,0 +1,8 @@ +name: Traefik +description: | + (Experimental) Traefik active load balancer +version: v1.0.0-beta.555-rancher1 +category: Load Balancing +maintainer: "Raul Sanchez " +minimum_rancher_version: v0.59.0 +license: