demo: Update documentation

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
Rolf Neugebauer 2017-04-07 09:40:58 +01:00
parent 01e39a16ac
commit 93a9a827b6
2 changed files with 15 additions and 37 deletions

View File

@ -5,6 +5,8 @@ This directory contains files used in moby demos.
Most of the scripts/files assume you are on a Mac. Most of the scripts/files assume you are on a Mac.
- Recent Docker for Mac installed (edge, nightly, master channel) - Recent Docker for Mac installed (edge, nightly, master channel)
- Currently, you need a *custom* version of VPNKit installed in Docker
for Mac. Contact @magnus or @rneugeba.
- For the GCP portion: `brew install google-cloud-sdk` - For the GCP portion: `brew install google-cloud-sdk`
- For `etcd`: `brew install etcd` - For `etcd`: `brew install etcd`
- Infrakit: Clone [infrakit](https://github.com/docker/infrakit) and - Infrakit: Clone [infrakit](https://github.com/docker/infrakit) and

View File

@ -1,57 +1,33 @@
This directory contains scripts/files to bootstrap a `etcd` cluster. This directory contains scripts/files to bootstrap a `etcd` cluster both on the local machine as well as on Google Cloud.
In the local, hyperkit based, setup, we use a `etcd` running in a An `etcd` cluster can be bootstrapped in different ways (see the [Documentatiob](https://coreos.com/etcd/docs/latest/op-guide/clustering.html) for more details. For the demo we use configuration via static IP addresses. With Infrakit these are managed by assigning `LogicalID`s to cluster members. The `LogicalID` is interpreted as a IP address.
Docker for Mac container to bootstrap the cluster. For a cloud based demo, we'd use `https://discovery.etcd.io`. The host/DfM side is setup with [dfm-setup.sh](./dfm-setup.sh).
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 takes the official `etcd` container and adds a [script](./etcd.sh) to start `etcd`. [etcd.sh](./etcd.sh) first attempts to join a new cluster. If that fails it attempts to join an existing cluster. Note, the number and members of the cluster are somewhat hard coded in the script.
## Simple single node cluster (OUTDATED) ## Preparation
- Edit `./dfm-setup.sh` and set `NUMPEERS` to `1` - Build the `etcd` image and then moby image:
- Start the etcd bootstrap container in on window:
```
./dfm-setup.sh
```
- In another window build/run the moby image:
``` ```
./build-pkg.sh ./build-pkg.sh
moby build etcd moby build etcd
moby run etcd
``` ```
## InfraKit cluster setup (OUTDATED) ## InfraKit cluster setup (OUTDATED)
This should create a HyperKit based, InfraKit managed `etcd` cluster with 5 `etcd` instances. This should create a HyperKit based, InfraKit managed `etcd` cluster with 3 `etcd` instances.
#### Infrakit setup Start InfraKit:
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 `cb420e3e50ea60afe58538b1d3cab1cb14059433`.
- 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:
```
infrakit-group-default
```
```
infrakit-flavor-vanilla
```
- Start the hyperkit instance plugin from this directory:
``` ```
infrakit-flavor-vanilla &
infrakit-group-default &
../../../bin/infrakit-instance-hyperkit ../../../bin/infrakit-instance-hyperkit
``` ```
#### etcd setup Note: The HyperKit InfraKit plugin must be started from the directory
where the `etcd` mobylinux image is located.
- Start the bootstrap `etcd`: Now, commit the new config:
```
./dfm-setup.sh
```
- Commit the infrakit config:
``` ```
infrakit group commit infrakit.json infrakit group commit infrakit.json
``` ```
@ -59,7 +35,7 @@ infrakit group commit infrakit.json
To check if everything is fine, note down the IP address from one of To check if everything is fine, note down the IP address from one of
the nodes and then: 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 docker run --rm -t quay.io/coreos/etcd:v3.1.5 etcdctl --endpoints http://192.168.65.200:2379 member list
``` ```
## Infrakit GCP setup ## Infrakit GCP setup