From cd33234a223da5078e72d9be2dffade1e172ac6c Mon Sep 17 00:00:00 2001 From: Josh Cox Date: Mon, 31 Jul 2017 15:38:01 -0500 Subject: [PATCH] Optional host_label --- .../3/{docker-compose.yml => docker-compose.yml.tpl} | 7 ++++++- templates/zookeeper/3/rancher-compose.yml | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) rename templates/zookeeper/3/{docker-compose.yml => docker-compose.yml.tpl} (92%) diff --git a/templates/zookeeper/3/docker-compose.yml b/templates/zookeeper/3/docker-compose.yml.tpl similarity index 92% rename from templates/zookeeper/3/docker-compose.yml rename to templates/zookeeper/3/docker-compose.yml.tpl index 31aeffd..59799ec 100644 --- a/templates/zookeeper/3/docker-compose.yml +++ b/templates/zookeeper/3/docker-compose.yml.tpl @@ -16,13 +16,17 @@ services: 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: @@ -31,7 +35,9 @@ services: 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 @@ -39,7 +45,6 @@ services: - SERVICE_VOLUME=${zk_data_dir} volumes: - zkdata:${zk_data_dir} - volume_driver: local image: rawmind/alpine-volume:0.0.2-1 volumes: zkconfig: diff --git a/templates/zookeeper/3/rancher-compose.yml b/templates/zookeeper/3/rancher-compose.yml index 33fe7af..15751d9 100644 --- a/templates/zookeeper/3/rancher-compose.yml +++ b/templates/zookeeper/3/rancher-compose.yml @@ -61,8 +61,8 @@ catalog: description: | Host label to use as zookeeper 'value' tag. Example: 'zookeeper=true' - required: true - default: "private=true" + required: false + default: "" type: "string" - variable: "VOLUME_DRIVER" description: "The VOLUME driver to associate with this server"