mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-24 03:15:36 +00:00
Merge pull request #1638 from rneugeba/demo-up2
Minor tweaks to the demo setup
This commit is contained in:
commit
6f2d7fe77d
@ -10,13 +10,13 @@ restarts.
|
|||||||
|
|
||||||
## Preparation
|
## Preparation
|
||||||
|
|
||||||
- Build the `etcd` image and then moby image:
|
- Build the `etcd` image and then moby image inside the `pkg` directory:
|
||||||
```
|
```
|
||||||
./build-pkg.sh
|
./build-pkg.sh
|
||||||
moby build etcd
|
moby build etcd
|
||||||
```
|
```
|
||||||
|
|
||||||
## InfraKit cluster setup (OUTDATED)
|
## InfraKit cluster setup
|
||||||
|
|
||||||
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 5 `etcd` instances.
|
||||||
|
|
||||||
@ -53,14 +53,12 @@ Build the image and upload it:
|
|||||||
moby build etcd
|
moby build etcd
|
||||||
```
|
```
|
||||||
|
|
||||||
Start the infrakit components in separate windows:
|
Start infrakit as above:
|
||||||
```
|
```
|
||||||
infrakit-group-default
|
./start-infrakit
|
||||||
infrakit-flavor-vanilla
|
|
||||||
infrakit-instance-gcp
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Commit the configuration:
|
Commit the configuration:
|
||||||
```
|
```
|
||||||
infrakit group commit infrakit-gce.json
|
infrakit group commit infrakit-gcp.json
|
||||||
```
|
```
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
##
|
|
||||||
## This script starts a etcd container which is used to bootstrap a
|
|
||||||
## local etcd cluster. The etcd container is started on a non-standard
|
|
||||||
## port to keep the standard port free for the cluster.
|
|
||||||
##
|
|
||||||
## If you have a local etcd installed (brew install etcd) you can
|
|
||||||
## point the cli at it as well:
|
|
||||||
##
|
|
||||||
## etcdctl --debug --endpoints http://0.0.0.0:2381 member list
|
|
||||||
##
|
|
||||||
|
|
||||||
# debug
|
|
||||||
set -x
|
|
||||||
set -v
|
|
||||||
|
|
||||||
# Change depending on the cluster size
|
|
||||||
NUMPEERS=5
|
|
||||||
|
|
||||||
# Start a local etcd for bootstrapping
|
|
||||||
NAME=etcd-bootstrap
|
|
||||||
PORT=2381
|
|
||||||
|
|
||||||
#UUID=$(uuidgen)
|
|
||||||
UUID=6c007a14875d53d9bf0ef5a6fc0257c817f0fb83
|
|
||||||
|
|
||||||
ID=$(docker run -d --rm --name ${NAME} \
|
|
||||||
-p ${PORT}:${PORT} \
|
|
||||||
quay.io/coreos/etcd:v3.1.5 /usr/local/bin/etcd \
|
|
||||||
--debug \
|
|
||||||
--name ${NAME} \
|
|
||||||
--listen-client-urls http://0.0.0.0:${PORT} \
|
|
||||||
--advertise-client-urls http://0.0.0.0:$PORT,http://192.168.65.2:$PORT \
|
|
||||||
--initial-cluster-token ${NAME} \
|
|
||||||
--initial-cluster-state new \
|
|
||||||
--auto-compaction-retention 0)
|
|
||||||
|
|
||||||
trap "docker kill ${ID}" 2
|
|
||||||
|
|
||||||
# Could poll until returns without error, but sleep for 2s for now
|
|
||||||
sleep 2
|
|
||||||
docker exec -t ${ID} etcdctl --endpoints http://0.0.0.0:${PORT} mk discovery/${UUID}/_config/size ${NUMPEERS}
|
|
||||||
|
|
||||||
echo "KEY: ${UUID}"
|
|
||||||
|
|
||||||
docker logs -f ${ID}
|
|
@ -16,7 +16,7 @@
|
|||||||
"kernel+initrd": "etcd",
|
"kernel+initrd": "etcd",
|
||||||
"Disk" : 1024,
|
"Disk" : 1024,
|
||||||
"CPUs" : 1,
|
"CPUs" : 1,
|
||||||
"Memory" : 1024
|
"Memory" : 512
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Flavor": {
|
"Flavor": {
|
||||||
|
@ -27,7 +27,7 @@ services:
|
|||||||
net: host
|
net: host
|
||||||
oomScoreAdj: -800
|
oomScoreAdj: -800
|
||||||
- name: nginx
|
- name: nginx
|
||||||
image: "nginx:alpine"
|
image: "nginx:1.11.12-alpine"
|
||||||
capabilities:
|
capabilities:
|
||||||
- CAP_NET_BIND_SERVICE
|
- CAP_NET_BIND_SERVICE
|
||||||
- CAP_CHOWN
|
- CAP_CHOWN
|
||||||
|
Loading…
Reference in New Issue
Block a user