Merge pull request #1484 from rneugeba/demo-plus

demo: Initial etcd cluster setup with InfraKit
This commit is contained in:
Rolf Neugebauer 2017-04-04 15:47:16 +01:00 committed by GitHub
commit c0e416a2a5
3 changed files with 73 additions and 2 deletions

View File

@ -5,8 +5,10 @@ Docker for Mac container to bootstrap the cluster. For a cloud based demo, we'd
The moby `etcd` package is build with [build-pkg.sh](./build-pkg.sh). It take the official `etcd` container and adds a [script](./etcd.sh) to start `etcd`. The moby `etcd` package is build with [build-pkg.sh](./build-pkg.sh). It take the official `etcd` container and adds a [script](./etcd.sh) to start `etcd`.
To run (for now):
## Simple single node cluster
- Edit `./dfm-setup.sh` and set `NUMPEERS` to `1`
- Start the etcd bootstrap container in on window: - Start the etcd bootstrap container in on window:
``` ```
./dfm-setup.sh ./dfm-setup.sh
@ -18,3 +20,44 @@ To run (for now):
moby build etcd moby build etcd
moby run etcd moby run etcd
``` ```
## InfraKit cluster setup
This should create a HyperKit based, InfraKit managed `etcd` cluster with 5 `etcd` instances.
#### Infrakit setup
You need the [infrakit](https://github.com/docker/infrakit) binaries for this. I normally compile from source using `make build-in-container`. The below was tried with commit `2153cbb0c28d450d271bbcdb9b3765eb486a9ac9`
- Make sure you start from scratch
```
rm -rf ~/.infrakit
```
- Start the infrakit plugins, each in it's own window from the root of the infrakit source tree:
```
./build/infrakit-group-default
```
```
./build/infrakit-flavor-vanilla
```
- Start the hyperkit instance plugin from this directory:
```
../../../bin/infrakit-instance-hyperkit
```
#### etcd setup
- Start the bootstrap `etcd`:
```
./dfm-setup.sh
```
- Commit the infrakit config:
```
~/src/docker/infrakit/build/infrakit group commit infrakit.json
```
To check if everything is fine, note down the IP address from one of
the nodes and then:
```
docker run --rm -t quay.io/coreos/etcd:v3.1.5 etcdctl --endpoints http://192.168.65.24:2379 member list
```

View File

@ -15,7 +15,7 @@ set -x
set -v set -v
# Change depending on the cluster size # Change depending on the cluster size
NUMPEERS=1 NUMPEERS=5
# Start a local etcd for bootstrapping # Start a local etcd for bootstrapping
NAME=etcd-bootstrap NAME=etcd-bootstrap

View File

@ -0,0 +1,28 @@
{
"ID": "cattle",
"Properties": {
"Allocation": {
"Size": 5
},
"Instance": {
"Plugin": "instance-hyperkit",
"Properties": {
"Moby": "etcd",
"Disk" : 0,
"CPUs" : 1,
"Memory" : 512
}
},
"Flavor": {
"Plugin": "flavor-vanilla",
"Properties": {
"Init": [
],
"Tags": {
"tier": "etcd-cluster",
"project": "infrakit"
}
}
}
}
}