This repository has been archived by the owner on Sep 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(blog-vulcan-example): add units for blog post
- Loading branch information
0 parents
commit b4c8c2b
Showing
13 changed files
with
169 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=Example 1.0.0 | ||
After=docker.service | ||
|
||
[Service] | ||
TimeoutStartSec=0 | ||
ExecStartPre=/usr/bin/docker pull coreos/example:1.0.0 | ||
ExecStart=/bin/bash -c '/usr/bin/docker start -a example-1A || /usr/bin/docker run --rm --name example-1A -p 8085:80 coreos/example:1.0.0' | ||
ExecStop=/bin/bash -c '/usr/bin/docker stop example-1A; \ | ||
/usr/bin/docker rm example-1A ' | ||
|
||
[X-Fleet] | ||
X-Conflicts=example-v1.0.0-*.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=Example 1.0.0 | ||
After=docker.service | ||
|
||
[Service] | ||
TimeoutStartSec=0 | ||
ExecStartPre=/usr/bin/docker pull coreos/example:1.0.0 | ||
ExecStart=/bin/bash -c '/usr/bin/docker start -a example-1B || /usr/bin/docker run --rm --name example-1B -p 8085:80 coreos/example:1.0.0' | ||
ExecStop=/bin/bash -c '/usr/bin/docker stop example-1B; \ | ||
/usr/bin/docker rm example-1B' | ||
|
||
[X-Fleet] | ||
X-Conflicts=example-v1.0.0-*.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=Example 2.0.0 | ||
After=docker.service | ||
|
||
[Service] | ||
TimeoutStartSec=0 | ||
ExecStartPre=/usr/bin/docker pull coreos/example:2.0.0 | ||
ExecStart=/bin/bash -c '/usr/bin/docker start -a example-2A || /usr/bin/docker run --rm --name example-2A -p 8086:80 coreos/example:2.0.0' | ||
ExecStop=/bin/bash -c '/usr/bin/docker stop example-2A; \ | ||
/usr/bin/docker rm example-2A' | ||
|
||
[X-Fleet] | ||
X-Conflicts=example-v2.0.0-*.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=Example 2.0.0 | ||
After=docker.service | ||
|
||
[Service] | ||
TimeoutStartSec=0 | ||
ExecStartPre=/usr/bin/docker pull coreos/example:2.0.0 | ||
ExecStart=/bin/bash -c '/usr/bin/docker start -a example-2B || /usr/bin/docker run --rm --name example-2B -p 8086:80 coreos/example:2.0.0' | ||
ExecStop=/bin/bash -c '/usr/bin/docker stop example-2B; \ | ||
/usr/bin/docker rm example-2B' | ||
|
||
[X-Fleet] | ||
X-Conflicts=example-v2.0.0-*.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[Unit] | ||
Description=Register for Example | ||
After=example-v1.0.0-A.service | ||
|
||
[Service] | ||
EnvironmentFile=/etc/environment | ||
RemainAfterExit=yes | ||
ExecStart=/bin/sh -c "/bin/etcdctl set \"/vulcand/upstreams/example/endpoints/mixed-register-v1.0.0-A.service\" http://$COREOS_PUBLIC_IPV4:8085; \ | ||
/bin/etcdctl set \"/vulcand/hosts/example.com/locations/home/path\" '/.*'; \ | ||
/bin/etcdctl set /vulcand/hosts/example.com/locations/home/upstream example" | ||
ExecStop=/bin/sh -c "/bin/etcdctl rm /vulcand/upstreams/example/endpoints/mixed-register-v1.0.0-A.service" | ||
|
||
[X-Fleet] | ||
X-ConditionMachineOf=example-v1.0.0-A.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[Unit] | ||
Description=Register for Example | ||
After=example-v1.0.0-B.service | ||
|
||
[Service] | ||
EnvironmentFile=/etc/environment | ||
RemainAfterExit=yes | ||
ExecStart=/bin/sh -c "/bin/etcdctl set \"/vulcand/upstreams/example/endpoints/mixed-register-v1.0.0-B.service\" http://$COREOS_PUBLIC_IPV4:8085; \ | ||
/bin/etcdctl set \"/vulcand/hosts/example.com/locations/home/path\" '/.*'; \ | ||
/bin/etcdctl set /vulcand/hosts/example.com/locations/home/upstream example" | ||
ExecStop=/bin/sh -c "/bin/etcdctl rm /vulcand/upstreams/example/endpoints/mixed-register-v1.0.0-B.service" | ||
|
||
[X-Fleet] | ||
X-ConditionMachineOf=example-v1.0.0-B.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[Unit] | ||
Description=Register for Example | ||
After=example-v2.0.0-A.service | ||
|
||
[Service] | ||
EnvironmentFile=/etc/environment | ||
RemainAfterExit=yes | ||
ExecStart=/bin/sh -c "/bin/etcdctl set \"/vulcand/upstreams/example/endpoints/mixed-register-v2.0.0-A.service\" http://$COREOS_PUBLIC_IPV4:8086; \ | ||
/bin/etcdctl set \"/vulcand/hosts/example.com/locations/home/path\" '/.*'; \ | ||
/bin/etcdctl set /vulcand/hosts/example.com/locations/home/upstream example" | ||
ExecStop=/bin/sh -c "/bin/etcdctl rm /vulcand/upstreams/example/endpoints/mixed-register-v2.0.0-A.service" | ||
|
||
[X-Fleet] | ||
X-ConditionMachineOf=example-v2.0.0-A.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[Unit] | ||
Description=Register for Example | ||
After=example-v2.0.0-B.service | ||
|
||
[Service] | ||
EnvironmentFile=/etc/environment | ||
RemainAfterExit=yes | ||
ExecStart=/bin/sh -c "/bin/etcdctl set \"/vulcand/upstreams/example/endpoints/mixed-register-v2.0.0-B.service\" http://$COREOS_PUBLIC_IPV4:8086; \ | ||
/bin/etcdctl set \"/vulcand/hosts/example.com/locations/home/path\" '/.*'; \ | ||
/bin/etcdctl set /vulcand/hosts/example.com/locations/home/upstream example" | ||
ExecStop=/bin/sh -c "/bin/etcdctl rm /vulcand/upstreams/example/endpoints/mixed-register-v2.0.0-B.service" | ||
|
||
[X-Fleet] | ||
X-ConditionMachineOf=example-v2.0.0-B.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=Register for Example | ||
After=example-v1.0.0-A.service | ||
|
||
[Service] | ||
EnvironmentFile=/etc/environment | ||
RemainAfterExit=yes | ||
ExecStart=/bin/sh -c "/bin/etcdctl set \"/vulcand/upstreams/example/endpoints/switch-register-v1.0.0-A.service\" http://$COREOS_PUBLIC_IPV4:8085; \ | ||
/bin/etcdctl set \"/vulcand/hosts/example.com/locations/home/path\" '/.*'"; | ||
ExecStop=/bin/sh -c "/bin/etcdctl rm /vulcand/upstreams/example/endpoints/switch-register-v1.0.0-A.service" | ||
|
||
[X-Fleet] | ||
X-ConditionMachineOf=example-v1.0.0-A.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=Register for Example | ||
After=example-v1.0.0-B.service | ||
|
||
[Service] | ||
EnvironmentFile=/etc/environment | ||
RemainAfterExit=yes | ||
ExecStart=/bin/sh -c "/bin/etcdctl set \"/vulcand/upstreams/example/endpoints/switch-register-v1.0.0-B.service\" http://$COREOS_PUBLIC_IPV4:8085; \ | ||
/bin/etcdctl set \"/vulcand/hosts/example.com/locations/home/path\" '/.*'"; | ||
ExecStop=/bin/sh -c "/bin/etcdctl rm /vulcand/upstreams/example/endpoints/switch-register-v1.0.0-B.service" | ||
|
||
[X-Fleet] | ||
X-ConditionMachineOf=example-v1.0.0-B.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=Register for Example | ||
After=example-v2.0.0-A.service | ||
|
||
[Service] | ||
EnvironmentFile=/etc/environment | ||
RemainAfterExit=yes | ||
ExecStart=/bin/sh -c "/bin/etcdctl set \"/vulcand/upstreams/example2/endpoints/switch-register-v2.0.0-A.service\" http://$COREOS_PUBLIC_IPV4:8086; \ | ||
/bin/etcdctl set \"/vulcand/hosts/example.com/locations/home/path\" '/.*'"; | ||
ExecStop=/bin/sh -c "/bin/etcdctl rm /vulcand/upstreams/example2/endpoints/switch-register-v2.0.0-A.service" | ||
|
||
[X-Fleet] | ||
X-ConditionMachineOf=example-v2.0.0-A.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=Register for Example | ||
After=example-v2.0.0-B.service | ||
|
||
[Service] | ||
EnvironmentFile=/etc/environment | ||
RemainAfterExit=yes | ||
ExecStart=/bin/sh -c "/bin/etcdctl set \"/vulcand/upstreams/example2/endpoints/switch-register-v2.0.0-B.service\" http://$COREOS_PUBLIC_IPV4:8086; \ | ||
/bin/etcdctl set \"/vulcand/hosts/example.com/locations/home/path\" '/.*'"; | ||
ExecStop=/bin/sh -c "/bin/etcdctl rm /vulcand/upstreams/example2/endpoints/switch-register-v2.0.0-B.service" | ||
|
||
[X-Fleet] | ||
X-ConditionMachineOf=example-v2.0.0-B.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[Unit] | ||
Description=Vulcan | ||
After=docker.service | ||
|
||
[Service] | ||
TimeoutStartSec=0 | ||
ExecStartPre=/usr/bin/docker pull mailgun/vulcand | ||
ExecStart=/bin/bash -c '/usr/bin/docker start -a vulcan1 || docker run --rm --name vulcan1 -p 80:80 -p 8182:8182 mailgun/vulcand /opt/vulcan/vulcand -apiInterface="0.0.0.0" -interface="0.0.0.0" -etcd="http://172.17.42.1:4001" -port=80 -apiPort=8182' | ||
ExecStop=/usr/bin/docker stop vulcan1 |