Skip to content

Commit de812f1

Browse files
author
Gabriel Monroy
committed
Merge pull request #2118 from mboersma/fix-user-data
ref(user-data): "make discovery-url" copies from user-data.example
2 parents eb7ad3e + 669893a commit de812f1

16 files changed

Lines changed: 53 additions & 27 deletions

File tree

.gitignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,11 @@ Vagrantfile.local
5757
.bundle
5858
/__init__.py
5959

60+
# Local user-data generated from user-data.example
61+
contrib/coreos/user-data
62+
6063
# EC2 CloudFormation Setup
6164
contrib/ec2/cloudformation.json
6265

6366
# GCE generated user-data
6467
contrib/gce/gce-user-data
65-
66-
# user-data backup file
67-
contrib/coreos/user-data.orig
68-

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ dev-registry: check-docker
1717
@echo " export DEV_REGISTRY=`boot2docker ip 2>/dev/null`:5000"
1818

1919
discovery-url:
20-
sed -e "s,# discovery:,discovery:," -e "s,discovery: https://discovery.etcd.io/.*,discovery: $$(curl -s -w '\n' https://discovery.etcd.io/new)," contrib/coreos/user-data > contrib/coreos/user-data.new
21-
mv contrib/coreos/user-data.new contrib/coreos/user-data
20+
sed -e "s,# discovery:,discovery:," -e "s,discovery: https://discovery.etcd.io/.*,discovery: $$(curl -s -w '\n' https://discovery.etcd.io/new)," contrib/coreos/user-data.example > contrib/coreos/user-data
2221

2322
build: check-docker
2423
@$(foreach C, $(COMPONENTS), $(MAKE) -C $(C) build &&) echo done

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ Note for Ubuntu users: the VirtualBox package in Ubuntu (as of the last known re
2525

2626
## Configure Discovery
2727

28-
Each time you spin up a new CoreOS cluster, you **must** provide a new [discovery service URL](https://coreos.com/docs/cluster-management/setup/cluster-discovery/) in the [CoreOS user-data](https://coreos.com/docs/cluster-management/setup/cloudinit-cloud-config/) file. This URL allows hosts to find each other and perform leader election.
28+
Each time you spin up a new CoreOS cluster, you **must** provide a new [discovery service URL](https://coreos.com/docs/cluster-management/setup/cluster-discovery/) in the [CoreOS user-data](https://coreos.com/docs/cluster-management/setup/cloudinit-cloud-config/) file. This unique discovery URL allows hosts to find each other and perform leader election.
2929

30-
Automatically generate a fresh discovery URL with:
30+
Create a user-data file with a new discovery URL this way:
3131

3232
```console
3333
$ make discovery-url
3434
```
3535

36-
or manually edit [contrib/coreos/user-data](contrib/coreos/user-data) and add a unique discovery URL generated from <https://discovery.etcd.io/new>.
36+
Or copy [`contrib/coreos/user-data.example`](contrib/coreos/user-data.example) to `contrib/coreos/user-data` and follow the directions in the `etcd:` section to add a unique discovery URL.
3737

3838
## Boot CoreOS
3939

@@ -201,7 +201,7 @@ Common issues that users have run into when provisioning Deis are detailed below
201201
Did you remember to add your SSH key to the ssh-agent? `ssh-add -L` should list the key you used to provision the servers. If it's not there, `ssh-add -K /path/to/your/key`.
202202

203203
#### When running a `deisctl` command - 'All the given peers are not reachable (Tried to connect to each peer twice and failed)'
204-
The most common cause of this issue is that a [new discovery URL](https://discovery.etcd.io/new) wasn't generated and updated in [contrib/coreos/user-data](contrib/coreos/user-data) before the cluster was launched. Each Deis cluster must have a unique discovery URL, else there will be entries for old hosts that etcd will try and fail to connect to. Try destroying and relaunching the cluster with a fresh discovery URL.
204+
The most common cause of this issue is that a [new discovery URL](https://discovery.etcd.io/new) wasn't generated and updated in `contrib/coreos/user-data` before the cluster was launched. Each Deis cluster must have a unique discovery URL, or else `etcd` will try and fail to connect to old hosts. Try destroying the cluster and relaunching the cluster with a fresh discovery URL.
205205

206206
#### Scaling an app doesn't work, and/or the app shows 'Welcome to nginx!'
207207
This usually means the controller failed to submit jobs to the scheduler. `deisctl journal controller` will show detailed error information, but the most common cause of this is that the cluster was created with the wrong SSH key for the `--auth` parameter. The key supplied with the `--auth` parameter must be the same key that was used to provision the Deis servers. If you suspect this to be the issue, you'll need to `clusters:destroy` the cluster and recreate it, along with the app.

Vagrantfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ Vagrant.configure("2") do |config|
123123
s.args = ["/tmp/vagrantfile-user-data", $num_instances]
124124
end
125125
config.vm.provision :shell, :inline => "mv /tmp/vagrantfile-user-data /var/lib/coreos-vagrant/", :privileged => true
126+
else
127+
config.vm.provision :shell do |s|
128+
s.inline = "echo \"File not found: #{CLOUD_CONFIG_PATH}\" &&" +
129+
"echo \"Run 'make discovery-url' first to create user-data.\" && exit 1"
130+
end
126131
end
127132

128133
end

contrib/bare-metal/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,14 @@ $ ssh-keygen -q -t rsa -f ~/.ssh/deis -N '' -C deis
1212
## Customize user-data
1313

1414
### Discovery URL
15-
Edit [user-data](../coreos/user-data) and add a new discovery URL.
16-
You can get a new one by sending a request to http://discovery.etcd.io/new.
15+
16+
Create a user-data file with a new discovery URL this way:
17+
18+
```console
19+
$ make discovery-url
20+
```
21+
22+
Or copy [`contrib/coreos/user-data.example`](../coreos/user-data.example) to `contrib/coreos/user-data` and follow the directions in the `etcd:` section to add a unique discovery URL.
1723

1824
### SSH Key
1925
Add the public key part for the SSH key generated in the first step to the [user-data](../coreos/user-data) file:

contrib/bumpver/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ $ ./contrib/bumpver/bumpver 0.14.0 \
4646
deisctl/deis-version \
4747
deisctl/deisctl.go \
4848
deisctl/README.md \
49-
contrib/coreos/user-data \
49+
contrib/coreos/user-data.example \
5050
controller/deis/__init__.py \
5151
README.md
5252
```

contrib/digitalocean/README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
# Provision a Deis Cluster on DigitalOcean
22

3-
## Customize cloud-config.yml
4-
Edit [user-data](../coreos/user-data) and add a discovery URL. This URL will be used by all nodes in this Deis cluster. You can get a new discovery URL by sending a request to http://discovery.etcd.io/new.
3+
## Discovery URL
4+
5+
Create a user-data file with a new discovery URL this way:
6+
7+
```console
8+
$ make discovery-url
9+
```
10+
11+
Or copy [`contrib/coreos/user-data.example`](../coreos/user-data.example) to `contrib/coreos/user-data` and follow the directions in the `etcd:` section to add a unique discovery URL.
512

613
## Install docl and authorize:
714
The docl gem consumes the DigitalOcean API.

contrib/ec2/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ Deis clusters of less than 3 nodes are unsupported.
3939

4040
## Customize user-data
4141

42-
Edit [user-data](../coreos/user-data) and add a new discovery URL.
43-
You can get a new one by sending a request to http://discovery.etcd.io/new, or automatically
44-
generate a fresh discovery URL with:
42+
Create a user-data file with a new discovery URL this way:
4543

4644
```console
4745
$ make discovery-url
4846
```
4947

48+
Or copy [`contrib/coreos/user-data.example`](../coreos/user-data.example) to `contrib/coreos/user-data` and follow the directions in the `etcd:` section to add a unique discovery URL.
49+
5050
## Customize cloudformation.json
5151
Any of the parameter defaults defined in deis.template.json can be overridden
5252
by setting the value in [cloudformation.json](cloudformation.json) like so:

contrib/openstack/README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,15 @@ Choose an existing keypair or upload a new public key, if desired.
3535
$ nova keypair-add --pub-key ~/.ssh/deis.pub deis-key
3636
```
3737

38-
### Customize cloud-config.yml
39-
Edit [user-data](../coreos/user-data) and add a discovery URL. This URL will be used by all nodes in this Deis cluster. You can get a new discovery URL by sending a request to http://discovery.etcd.io/new.
38+
### Customize user-data
39+
40+
Create a user-data file with a new discovery URL this way:
41+
42+
```console
43+
$ make discovery-url
44+
```
45+
46+
Or copy [`contrib/coreos/user-data.example`](../coreos/user-data.example) to `contrib/coreos/user-data` and follow the directions in the `etcd:` section to add a unique discovery URL.
4047

4148
### Choose number of instances
4249
By default, the provision script will provision 3 servers. You can override this by setting `DEIS_NUM_INSTANCES`:

0 commit comments

Comments
 (0)