-
Notifications
You must be signed in to change notification settings - Fork 0
/
boot_coreos.sh
executable file
·35 lines (32 loc) · 977 Bytes
/
boot_coreos.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
if [ -n "$1" ]; then
DROPLET_NAME=$1
else
DROPLET_NAME=tcore00
fi
curl -X POST "https://api.digitalocean.com/v2/droplets" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DO_TOKEN" \
-d'{"name":"'"$DROPLET_NAME"'",
"region":"nyc3",
"image":"coreos-stable",
"size":"512mb",
"private_networking":true,
"ssh_keys":[603313],
"user_data":
"#cloud-config
coreos:
etcd:
# generate a new token for each unique cluster from https://discovery.etcd.io/new
discovery: '"$DISCOVERY_URL"'
# use $public_ipv4 if your datacenter of choice does not support private networking
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
fleet:
public-ip: $private_ipv4 # used for fleetctl ssh command
metadata: region=nyc3,public_ip=$public_ipv4
units:
- name: etcd.service
command: start
- name: fleet.service
command: start"}'