Merge pull request #500 from rawmind0/master

Traefik-feat: go templating for add acme optional volume for persistence
This commit is contained in:
Raúl Sánchez 2017-05-03 22:34:20 +02:00 committed by GitHub
commit 9d11f7a1af
2 changed files with 26 additions and 0 deletions

View File

@ -24,6 +24,8 @@
- insecure_skip = false # Enable InsecureSkipVerify param. - insecure_skip = false # Enable InsecureSkipVerify param.
- refresh_interval = 10s # Interval to refresh traefik rules.toml from rancher-metadata. - 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: ### Service configuration labels:
Traefik labels has to be added in your services, in order to get included in traefik dynamic config. Traefik labels has to be added in your services, in order to get included in traefik dynamic config.

View File

@ -9,6 +9,9 @@ traefik:
io.rancher.scheduler.affinity:host_label: ${host_label} 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.scheduler.affinity:container_label_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name}
io.rancher.sidekicks: traefik-conf io.rancher.sidekicks: traefik-conf
{{- if eq .Values.acme_enable "true" -}}
,traefik-acme
{{- end}}
io.rancher.container.hostname_override: container_name io.rancher.container.hostname_override: container_name
tty: true tty: true
log_opt: {} log_opt: {}
@ -18,13 +21,18 @@ traefik:
- TRAEFIK_HTTP_PORT=${http_port} - TRAEFIK_HTTP_PORT=${http_port}
- TRAEFIK_HTTPS_PORT=${https_port} - TRAEFIK_HTTPS_PORT=${https_port}
- TRAEFIK_HTTPS_ENABLE=${https_enable} - TRAEFIK_HTTPS_ENABLE=${https_enable}
{{- if eq .Values.acme_enable "true"}}
- TRAEFIK_ACME_ENABLE=${acme_enable} - TRAEFIK_ACME_ENABLE=${acme_enable}
- TRAEFIK_ACME_EMAIL=${acme_email} - TRAEFIK_ACME_EMAIL=${acme_email}
- TRAEFIK_ACME_ONDEMAND=${acme_ondemand} - TRAEFIK_ACME_ONDEMAND=${acme_ondemand}
- TRAEFIK_ACME_ONHOSTRULE=${acme_onhostrule} - TRAEFIK_ACME_ONHOSTRULE=${acme_onhostrule}
{{- end}}
- TRAEFIK_INSECURE_SKIP=${insecure_skip} - TRAEFIK_INSECURE_SKIP=${insecure_skip}
volumes_from: volumes_from:
- traefik-conf - traefik-conf
{{- if eq .Values.acme_enable "true"}}
- traefik-acme
{{- end}}
traefik-conf: traefik-conf:
log_driver: '' log_driver: ''
labels: labels:
@ -38,3 +46,19 @@ traefik-conf:
net: none net: none
volumes: volumes:
- /opt/tools - /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:
- /opt/traefik/acme
volume_driver: ${VOLUME_DRIVER}
image: rawmind/alpine-volume:0.0.2-1
{{- end}}