Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/graemej/k8s-etcd
Docker container for etcd-on-Kubernetes
https://github.com/graemej/k8s-etcd
Last synced: about 1 month ago
JSON representation
Docker container for etcd-on-Kubernetes
- Host: GitHub
- URL: https://github.com/graemej/k8s-etcd
- Owner: graemej
- Created: 2014-12-04T19:35:31.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-05T19:42:04.000Z (about 10 years ago)
- Last Synced: 2024-08-02T12:51:24.365Z (4 months ago)
- Language: Shell
- Size: 125 KB
- Stars: 4
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-starred - graemej/k8s-etcd - Docker container for etcd-on-Kubernetes (others)
README
# k8s-etcd
Docker container to run `etcd` (0.4.6) in an Ubuntu 14.04 container with configuration settings from the environment.
## environment
The names of these environment variables are carefully chosen for compatibility with what Kubernetes (primarily GKE) provides for defined services.
* `ETCD_SERVER_ID`: required, integer 1..cluster size
* for each etcd instance in the cluster
* `ETCD_CLIENT__SERVICE_HOST`: IP address of the etcd instance
* `ETCD_CLIENT__SERVICE_PORT`: port number of the etcd client service (4001)
* `ETCD_PEER__SERVICE_HOST`: IP address of the etcd instance
* `ETCD_PEER__SERVICE_PORT`: port number of the etcd client service## notes
To start a two node cluster, run this to start the first node:
```
HOST_IP=$(ip ro get 8.8.8.8 | grep -oP "(?<=src )(\S+)")
docker run \
-p 4002:4001 \
-p 7002:7001 \
-e ETCD_SERVER_ID=1 \
-e ETCD_CLIENT_1_SERVICE_HOST=`ip ro get 8.8.8.8 | grep -oP "(?<=src )(\S+)"` \
-e ETCD_CLIENT_1_SERVICE_PORT=4002 \
-e ETCD_PEER_1_SERVICE_HOST=`ip ro get 8.8.8.8 | grep -oP "(?<=src )(\S+)"` \
-e ETCD_PEER_1_SERVICE_PORT=7002 \
-e ETCD_CLIENT_2_SERVICE_HOST=`ip ro get 8.8.8.8 | grep -oP "(?<=src )(\S+)"` \
-e ETCD_CLIENT_2_SERVICE_PORT=4003 \
-e ETCD_PEER_2_SERVICE_HOST=`ip ro get 8.8.8.8 | grep -oP "(?<=src )(\S+)"` \
-e ETCD_PEER_2_SERVICE_PORT=7003 \
graemej/k8s-etcd
```and this to start the second one:
```
docker run \
-p 4003:4001 \
-p 7003:7001 \
-e ETCD_SERVER_ID=2 \
-e ETCD_CLIENT_1_SERVICE_HOST=`ip ro get 8.8.8.8 | grep -oP "(?<=src )(\S+)"` \
-e ETCD_CLIENT_1_SERVICE_PORT=4002 \
-e ETCD_PEER_1_SERVICE_HOST=`ip ro get 8.8.8.8 | grep -oP "(?<=src )(\S+)"` \
-e ETCD_PEER_1_SERVICE_PORT=7002 \
-e ETCD_CLIENT_2_SERVICE_HOST=`ip ro get 8.8.8.8 | grep -oP "(?<=src )(\S+)"` \
-e ETCD_CLIENT_2_SERVICE_PORT=4003 \
-e ETCD_PEER_2_SERVICE_HOST=`ip ro get 8.8.8.8 | grep -oP "(?<=src )(\S+)"` \
-e ETCD_PEER_2_SERVICE_PORT=7003 \
graemej/k8s-etcd
```