diff --git a/.gitignore b/.gitignore index fe585680..2f0b1f75 100644 --- a/.gitignore +++ b/.gitignore @@ -114,3 +114,5 @@ kubeconfig_remote .cache .pytest_cache + +workspace/ diff --git a/.travis.yml b/.travis.yml index e37ff360..6ed1e5cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,10 +56,11 @@ jobs: - docker-compose -f docker-compose.etcd-volume.yml up -d - docker-compose -f docker-compose.etcd-volume.yml exec etcd etcdctl mkdir /travis/ - docker-compose -f docker-compose.etcd-volume.yml exec etcd etcdctl set /travis/commit $TRAVIS_COMMIT - - docker-compose -f docker-compose.etcd-volume.yml exec etcd etcdctl backup --data-dir /0.etcd/ --backup-dir /root/backup/ + - docker-compose -f docker-compose.etcd-volume.yml exec etcd etcdctl backup --data-dir /*.etcd/ --backup-dir /root/backup/ - docker-compose -f docker-compose.etcd-volume.yml stop - docker-compose -f docker-compose.etcd-volume.yml rm -fv - - sed -i 's/#//g' docker-compose.etcd-volume.yml + # restore and verify + - export ETCD_DATA_DIR=/root/backup ETCD_FORCE_NEW_CLUSTER=1 - docker-compose -f docker-compose.etcd-volume.yml up -d - docker-compose -f docker-compose.etcd-volume.yml exec etcd etcdctl ls --recursive /travis/ - | diff --git a/docker-compose.auth.yml b/docker-compose.auth.yml index 95456bb9..4f5cffdc 100644 --- a/docker-compose.auth.yml +++ b/docker-compose.auth.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3.2' services: ldap: image: osixia/openldap diff --git a/docker-compose.demo.yml b/docker-compose.demo.yml index d20a738c..64841ad4 100644 --- a/docker-compose.demo.yml +++ b/docker-compose.demo.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3.2' services: api: image: kqueen/api:v0.18 diff --git a/docker-compose.etcd-volume.yml b/docker-compose.etcd-volume.yml index 5f88d591..b2eb4921 100644 --- a/docker-compose.etcd-volume.yml +++ b/docker-compose.etcd-volume.yml @@ -1,19 +1,18 @@ -version: '2' +version: '3.2' networks: default: driver: bridge ipam: driver: default config: - - subnet: 172.16.238.0/24 - gateway: 172.16.238.1 + - + # your docker env subnet + subnet: 172.16.254.0/24 services: etcd: image: quay.io/coreos/etcd:latest ports: - 127.0.0.1:4001:4001 - volumes: - - /tmp/backup/:/root/backup/ environment: ETCD_NAME: 0 ETCD_INITIAL_ADVERTISE_PEER_URLS: http://etcd:2380 @@ -22,5 +21,16 @@ services: ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:4001 ETCD_LISTEN_PEER_URLS: http://0.0.0.0:2380 ETCD_ADVERTISE_CLIENT_URLS: http://127.0.0.1:4001,http://etcd:4001 - #ETCD_DATA_DIR: /root/backup/ - #ETCD_FORCE_NEW_CLUSTER: 1 + ETCD_DATA_DIR: ${ETCD_DATA_DIR:-/default.etcd} + ETCD_FORCE_NEW_CLUSTER: ${ETCD_FORCE_NEW_CLUSTER:-0} + + volumes: + - type: bind + source: ./workspace/etcd-data + target: /default.etcd + #- type: volume + #source: etcd-data + #target: /default.etcd + +volumes: + etcd-data: diff --git a/docker-compose.kubernetes.yml b/docker-compose.kubernetes.yml index 58b55989..3f22eee8 100644 --- a/docker-compose.kubernetes.yml +++ b/docker-compose.kubernetes.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3.2' services: apiserver: image: gcr.io/google_containers/hyperkube-amd64:v1.9.0 diff --git a/docker-compose.production.yml b/docker-compose.production.yml index 8ab870e1..995a170e 100644 --- a/docker-compose.production.yml +++ b/docker-compose.production.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3.2' services: etcd: restart: always diff --git a/docker-compose.yml b/docker-compose.yml index ad66c7f5..187736a9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,12 +1,13 @@ -version: '2' +version: '3.2' networks: default: driver: bridge ipam: driver: default config: - - subnet: 172.16.238.0/24 - gateway: 172.16.238.1 + - + # your docker env subnet + subnet: 172.16.254.0/24 services: etcd: image: quay.io/coreos/etcd:latest @@ -20,3 +21,4 @@ services: ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:4001 ETCD_LISTEN_PEER_URLS: http://0.0.0.0:2380 ETCD_ADVERTISE_CLIENT_URLS: http://127.0.0.1:4001,http://etcd:4001 +