Upgrade mesos/docker cluster to docker-compose 1.5.0

- Migrate to the new env var interpolation syntax (backwards incompatibile)
This commit is contained in:
Karl Isenberg 2015-11-03 16:58:13 -08:00
parent c24873743f
commit 34ca69cd50
2 changed files with 14 additions and 25 deletions

View File

@ -35,14 +35,14 @@ mesosslave:
- bash - bash
- -xc - -xc
- > - >
NAME=$(cut -f2 -d/ <<<${MESOSMASTER1_NAME}) && NAME=$$(cut -f2 -d/ <<<$${MESOSMASTER1_NAME}) &&
N=${NAME##*_} && N=$${NAME##*_} &&
DOCKER_NETWORK_OFFSET=0.0.${N}.0 DOCKER_NETWORK_OFFSET=0.0.$${N}.0
exec wrapdocker mesos-slave exec wrapdocker mesos-slave
--work_dir="/var/tmp/mesos/${N}" --work_dir="/var/tmp/mesos/$${N}"
--attributes="rack:${N};gen:201${N}" --attributes="rack:$${N};gen:201$${N}"
--hostname=$(getent hosts mesosslave | cut -d' ' -f1 | sort -u | tail -1) --hostname=$$(getent hosts mesosslave | cut -d' ' -f1 | sort -u | tail -1)
command: ~ command: []
environment: environment:
- MESOS_MASTER=mesosmaster1:5050 - MESOS_MASTER=mesosmaster1:5050
- MESOS_PORT=5051 - MESOS_PORT=5051
@ -66,13 +66,13 @@ apiserver:
- /bin/bash - /bin/bash
- "-ceu" - "-ceu"
- > - >
echo "Hostname: $(hostname -f) ($(hostname -f | xargs resolveip))" && echo "Hostname: $$(hostname -f) ($$(hostname -f | xargs resolveip))" &&
(grep "mesos-master\s*=" /opt/mesos-cloud.conf || echo " mesos-master = mesosmaster1:5050" >> /opt/mesos-cloud.conf) && (grep "mesos-master\s*=" /opt/mesos-cloud.conf || echo " mesos-master = mesosmaster1:5050" >> /opt/mesos-cloud.conf) &&
await-health-check "-t=${MESOS_DOCKER_ETCD_TIMEOUT}" http://etcd:4001/health && await-health-check "-t=${MESOS_DOCKER_ETCD_TIMEOUT}" http://etcd:4001/health &&
await-health-check "-t=${MESOS_DOCKER_MESOS_TIMEOUT}" http://mesosmaster1:5050/health && await-health-check "-t=${MESOS_DOCKER_MESOS_TIMEOUT}" http://mesosmaster1:5050/health &&
await-file "-t=${KUBE_KEYGEN_TIMEOUT}" /var/run/kubernetes/auth/apiserver.crt && await-file "-t=${KUBE_KEYGEN_TIMEOUT}" /var/run/kubernetes/auth/apiserver.crt &&
km apiserver km apiserver
--address=$(resolveip apiserver) --address=$$(resolveip apiserver)
--external-hostname=apiserver --external-hostname=apiserver
--etcd-servers=http://etcd:4001 --etcd-servers=http://etcd:4001
--port=8888 --port=8888
@ -90,10 +90,6 @@ apiserver:
--runtime-config=experimental/v1alpha1 --runtime-config=experimental/v1alpha1
--v=4 --v=4
ports: [ "8888:8888", "6443:6443" ] ports: [ "8888:8888", "6443:6443" ]
environment:
- MESOS_DOCKER_ETCD_TIMEOUT
- MESOS_DOCKER_MESOS_TIMEOUT
- KUBE_KEYGEN_TIMEOUT
volumes: volumes:
- ${MESOS_DOCKER_WORK_DIR}/auth:/var/run/kubernetes/auth:ro - ${MESOS_DOCKER_WORK_DIR}/auth:/var/run/kubernetes/auth:ro
links: links:
@ -106,20 +102,17 @@ controller:
- /bin/bash - /bin/bash
- "-ceu" - "-ceu"
- > - >
echo "Hostname: $(hostname -f) ($(hostname -f | xargs resolveip))" && echo "Hostname: $$(hostname -f) ($$(hostname -f | xargs resolveip))" &&
(grep "mesos-master\s*=" /opt/mesos-cloud.conf || echo " mesos-master = mesosmaster1:5050" >> /opt/mesos-cloud.conf) && (grep "mesos-master\s*=" /opt/mesos-cloud.conf || echo " mesos-master = mesosmaster1:5050" >> /opt/mesos-cloud.conf) &&
await-health-check "-t=${MESOS_DOCKER_MESOS_TIMEOUT}" http://mesosmaster1:5050/health && await-health-check "-t=${MESOS_DOCKER_MESOS_TIMEOUT}" http://mesosmaster1:5050/health &&
await-health-check "-t=${MESOS_DOCKER_API_TIMEOUT}" http://apiserver:8888/healthz && await-health-check "-t=${MESOS_DOCKER_API_TIMEOUT}" http://apiserver:8888/healthz &&
km controller-manager km controller-manager
--address=$(resolveip controller) --address=$$(resolveip controller)
--master=http://apiserver:8888 --master=http://apiserver:8888
--cloud-config=/opt/mesos-cloud.conf --cloud-config=/opt/mesos-cloud.conf
--service-account-private-key-file=/var/run/kubernetes/auth/service-accounts.key --service-account-private-key-file=/var/run/kubernetes/auth/service-accounts.key
--root-ca-file=/var/run/kubernetes/auth/root-ca.crt --root-ca-file=/var/run/kubernetes/auth/root-ca.crt
--v=4 --v=4
environment:
- MESOS_DOCKER_MESOS_TIMEOUT
- MESOS_DOCKER_API_TIMEOUT
volumes: volumes:
- ${MESOS_DOCKER_WORK_DIR}/auth:/var/run/kubernetes/auth:ro - ${MESOS_DOCKER_WORK_DIR}/auth:/var/run/kubernetes/auth:ro
links: links:
@ -132,13 +125,13 @@ scheduler:
- /bin/bash - /bin/bash
- "-ceu" - "-ceu"
- > - >
echo "Hostname: $(hostname -f) ($(hostname -f | xargs resolveip))" && echo "Hostname: $$(hostname -f) ($$(hostname -f | xargs resolveip))" &&
(grep "mesos-master\s*=" /opt/mesos-cloud.conf || echo " mesos-master = mesosmaster1:5050" >> /opt/mesos-cloud.conf) && (grep "mesos-master\s*=" /opt/mesos-cloud.conf || echo " mesos-master = mesosmaster1:5050" >> /opt/mesos-cloud.conf) &&
await-health-check "-t=${MESOS_DOCKER_ETCD_TIMEOUT}" http://etcd:4001/health && await-health-check "-t=${MESOS_DOCKER_ETCD_TIMEOUT}" http://etcd:4001/health &&
await-health-check "-t=${MESOS_DOCKER_MESOS_TIMEOUT}" http://mesosmaster1:5050/health && await-health-check "-t=${MESOS_DOCKER_MESOS_TIMEOUT}" http://mesosmaster1:5050/health &&
await-health-check "-t=${MESOS_DOCKER_API_TIMEOUT}" http://apiserver:8888/healthz && await-health-check "-t=${MESOS_DOCKER_API_TIMEOUT}" http://apiserver:8888/healthz &&
km scheduler km scheduler
--address=$(resolveip scheduler) --address=$$(resolveip scheduler)
--hostname-override=scheduler --hostname-override=scheduler
--etcd-servers=http://etcd:4001 --etcd-servers=http://etcd:4001
--mesos-user=root --mesos-user=root
@ -151,10 +144,6 @@ scheduler:
--v=4 --v=4
--executor-logv=4 --executor-logv=4
--profiling=true --profiling=true
environment:
- MESOS_DOCKER_ETCD_TIMEOUT
- MESOS_DOCKER_MESOS_TIMEOUT
- MESOS_DOCKER_API_TIMEOUT
links: links:
- etcd - etcd
- mesosmaster1 - mesosmaster1

View File

@ -36,7 +36,7 @@ RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 581
&& \ && \
apt-get clean apt-get clean
RUN pip install -U docker-compose RUN pip install -U docker-compose==1.5.0
RUN go get github.com/tools/godep RUN go get github.com/tools/godep