Skip to content

Commit 445dbae

Browse files
committed
ref(user-data): use default etcd2 and flannel services
1 parent f9cd978 commit 445dbae

8 files changed

Lines changed: 126 additions & 211 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ discovery-url:
3434
@for i in 1 2 3 4 5; do \
3535
URL=`curl -s -w '\n' https://discovery.etcd.io/new?size=$$DEIS_NUM_INSTANCES`; \
3636
if [ ! -z $$URL ]; then \
37-
sed -e "s,discovery #DISCOVERY_URL,discovery $$URL," contrib/coreos/user-data.example > contrib/coreos/user-data; \
37+
sed -e "s,discovery: #DISCOVERY_URL,discovery: $$URL," contrib/coreos/user-data.example > contrib/coreos/user-data; \
3838
echo "Wrote $$URL to contrib/coreos/user-data"; \
3939
break; \
4040
fi; \

Vagrantfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,8 @@ Vagrant.configure("2") do |config|
7878

7979
config.trigger.before :up do
8080
if File.exists?(CLOUD_CONFIG_PATH) && !File.readlines(CLOUD_CONFIG_PATH).grep(/\s*discovery #DISCOVERY_URL/).any?
81-
# Vagrant binds the VMs IP in VirtualBox's bridge network to the eth1 interface instead of eth0.
82-
# This necessitates the substitution below, which is not required anywhere except in Vagrant.
8381
user_data = File.read(CLOUD_CONFIG_PATH)
84-
new_userdata = user_data.gsub("/opt/bin/flanneld --ip-masq=true", "/opt/bin/flanneld --iface=eth1 --ip-masq=true")
82+
new_userdata = user_data.gsub("coreos:", "coreos:\n flannel:\n interface: $public_ipv4")
8583
File.open(CLOUD_CONFIG_PATH, "w") {|file| file.puts new_userdata }
8684
else
8785
raise Vagrant::Errors::VagrantError.new, "Run 'make discovery-url' first to create user-data."

contrib/aws/gen-json.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
Description=Prepares the etcd data directory
7474
Requires=media-etcd.mount
7575
After=media-etcd.mount
76-
Before=etcd.service
76+
Before=etcd2.service
7777
[Service]
7878
Type=oneshot
7979
RemainAfterExit=yes
@@ -92,7 +92,7 @@
9292
dict({'name': 'format-etcd-volume.service', 'command': 'start', 'content': FORMAT_ETCD_VOLUME}),
9393
dict({'name': 'media-etcd.mount', 'command': 'start', 'content': MOUNT_ETCD_VOLUME}),
9494
dict({'name': 'prepare-etcd-data-directory.service', 'command': 'start', 'content': PREPARE_ETCD_DATA_DIRECTORY}),
95-
dict({'name': 'etcd.service', 'drop-ins': [{'name': '90-after-etcd-volume.conf', 'content': ETCD_DROPIN}]})
95+
dict({'name': 'etcd2.service', 'drop-ins': [{'name': '90-after-etcd-volume.conf', 'content': ETCD_DROPIN}]})
9696
]
9797

9898
with open(os.path.join(CURR_DIR, '..', 'coreos', 'user-data'), 'r') as f:

contrib/azure/azure-coreos-cluster

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,19 @@ parser.add_argument('--no-discovery-url', action='store_true',
6161
cloud_init_template = """#cloud-config
6262
6363
coreos:
64-
etcd:
64+
etcd2:
6565
# generate a new token for each unique cluster from https://discovery.etcd.io/new
6666
discovery: {0}
67-
# deployments across multiple cloud services will need to use $public_ipv4
68-
addr: $private_ipv4:4001
69-
peer-addr: $private_ipv4:7001
67+
# multi-region and multi-cloud deployments need to use $public_ipv4
68+
advertise-client-urls: http://$private_ipv4:2379
69+
initial-advertise-peer-urls: http://$private_ipv4:2380
70+
# listen on both the official ports and the legacy ports
71+
# legacy ports can be omitted if your application doesn't depend on them
72+
listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001
73+
listen-peer-urls: http://$private_ipv4:2380,http://$private_ipv4:7001
74+
data-dir: /var/lib/etcd2
7075
units:
71-
- name: etcd.service
76+
- name: etcd2.service
7277
command: start
7378
- name: fleet.service
7479
command: start

0 commit comments

Comments
 (0)