From 51d60e72976f01fcc28a5bd34ad26e4cd14d6755 Mon Sep 17 00:00:00 2001 From: William Miceli <9000802+WilliamMiceli@users.noreply.github.com> Date: Wed, 14 Mar 2018 11:57:31 -0400 Subject: [PATCH] Allow specifying which host should run ZeroTier --- templates/zerotier/0/docker-compose.yml | 2 ++ templates/zerotier/0/rancher-compose.yml | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/templates/zerotier/0/docker-compose.yml b/templates/zerotier/0/docker-compose.yml index 3518cff..1a14e6d 100644 --- a/templates/zerotier/0/docker-compose.yml +++ b/templates/zerotier/0/docker-compose.yml @@ -10,6 +10,8 @@ services: - -d devices: - "/dev/net/tun" + labels: + io.rancher.scheduler.affinity:host_label: ${HOST_LABEL_KEY}=${HOST_LABEL_VALUE} network_mode: - "host" restart: unless-stopped diff --git a/templates/zerotier/0/rancher-compose.yml b/templates/zerotier/0/rancher-compose.yml index 1f2c7cc..2f87017 100644 --- a/templates/zerotier/0/rancher-compose.yml +++ b/templates/zerotier/0/rancher-compose.yml @@ -17,4 +17,16 @@ catalog: The path to where ZeroTier should hold it's persistent files. Preferrably a local-only location. default: "/var/lib/Storage-Local/zerotier-one" required: false + type: string + - variable: "HOST_LABEL_KEY" + label: "Host Label Key" + description: | + The Label Key on the host which ZeroTier should be deployed + required: true + type: string + - variable: "HOST_LABEL_VALUE" + label: "Host Label Value" + description: | + The Label Value on the host which ZeroTier should be deployed + required: true type: string \ No newline at end of file