Compare commits
4 Commits
master
...
develop-et
Author | SHA1 | Date |
---|---|---|
Gael | c5f2f2e5b8 | 1 month ago |
Gael | 35bb78b1ff | 1 month ago |
Gael | b4fdbab974 | 1 month ago |
Gael | 709b5df2e7 | 1 month ago |
2 changed files with 62 additions and 0 deletions
@ -0,0 +1,36 @@ |
|||
version: '3.3' |
|||
|
|||
services: |
|||
etcd: |
|||
image: quay.io/coreos/etcd:v3.4.31 |
|||
entrypoint: /usr/local/bin/etcd |
|||
container_name: ${etcdServName} |
|||
restart: ${restartPolicy} |
|||
ports: |
|||
- 2380:2380 |
|||
expose: |
|||
- 2379 |
|||
volumes: |
|||
- etcdData:/etcd-data |
|||
command: |
|||
- '--name=${site}' |
|||
- '--initial-advertise-peer-urls=http://${site}.${domain}:2380' |
|||
- '--listen-peer-urls=http://0.0.0.0:2380' |
|||
- '--listen-client-urls=http://0.0.0.0:2379' |
|||
- '--advertise-client-urls=http://0.0.0.0:2379' |
|||
- '--initial-cluster=${etcdCluster}' |
|||
- '--data-dir=/etcd-data' |
|||
- '--initial-cluster-token=${etcdToken}' |
|||
volumes: |
|||
etcdData: |
|||
|
|||
## |
|||
## CONF A AJOUTER DANS LE DOCKER.ENV |
|||
## |
|||
|
|||
# ####################################### |
|||
# # ETCD |
|||
# etcdCluster="kaz1=http://100.80.0.2:2380,kaz2=http://100.81.0.2:2380" |
|||
# etcdToken=oqpshgvpiurevboifpiuverpoigjbpfidb |
|||
# etcdServName=etcdServ |
|||
|
@ -0,0 +1,26 @@ |
|||
#!/bin/bash |
|||
|
|||
# install etcdctl si non installé |
|||
# positionne les variables d'environnement |
|||
|
|||
# usage : source etcdctl.sh |
|||
# todo, le mettre dans le .bashrc, mais après avoir certifié que ça ne plante jamais ! |
|||
|
|||
KAZ_ROOT="/kaz" |
|||
. "${KAZ_ROOT}/bin/.commonFunctions.sh" |
|||
setKazVars |
|||
. "${DOCKERS_ENV}" |
|||
|
|||
which etcdctl | grep -i etcdctl >/dev/null || { apt install -y etcd-client ;} |
|||
etcdServIP=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${etcdServName}) |
|||
|
|||
export ETCDCTL_ENDPOINTS="${etcdServIP}:2379" |
|||
export ETCDCTL_API=3 |
|||
|
|||
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then |
|||
#echo "Exécuté" |
|||
echo "${RED}\"source ectdctl.sh\" pour que les variables d'environnement soient correctement définies. $NC" |
|||
#else |
|||
#echo "Source" |
|||
|
|||
fi |
Loading…
Reference in new issue