Files
kubernetes/cluster/mesos/docker/docker-compose.yml
Sergiusz Urbaniak 67e98fcfa8 executor, scheduler: make default pod roles configurable
Currently if a pod is being scheduled with no meta.RolesKey label
attached to it, per convention the first configured mesos (framework)
role is being used.

This is quite limiting and also lets e2e tests fail. This commit
introduces a new configuration option "--mesos-default-pod-roles" defaulting to
"*" which defines the default pod roles in case the meta.RolesKey pod
label is missing.
2015-12-14 15:18:39 +01:00

168 lines
5.6 KiB
YAML

ambassador:
image: cpuguy83/docker-grand-ambassador:0.9.1
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: "-name docker_apiserver_1"
etcd:
hostname: etcd
image: quay.io/coreos/etcd:v2.2.1
ports: [ "4001:4001" ]
command: >
--listen-client-urls 'http://etcd:4001'
--advertise-client-urls 'http://etcd:4001'
--initial-cluster-state new
mesosmaster1:
hostname: mesosmaster1
image: mesosphere/mesos:0.24.0-1.0.27.ubuntu1404
entrypoint: [ "mesos-master" ]
ports: [ "5050:5050" ]
environment:
- MESOS_HOSTNAME=mesosmaster1
- MESOS_PORT=5050
- MESOS_LOG_DIR=/var/log/mesos
- MESOS_QUORUM=1
- MESOS_REGISTRY=in_memory
- MESOS_WORK_DIR=/var/lib/mesos
- MESOS_ROLES=public
links:
- etcd
- "ambassador:apiserver"
mesosslave:
hostname: mesosslave
privileged: true
image: mesosphere/mesos-slave-dind:0.2.2_mesos-0.24.0_docker-1.8.2_ubuntu-14.04.3
ports: [ "10248","10249" ]
entrypoint:
- bash
- -xc
- >
NAME=$$(cut -f2 -d/ <<<$${MESOSMASTER1_NAME}) &&
N=$${NAME##*_} &&
PUBLIC_RESOURCES="$$(if [ $${N} = 2 ]; then echo ";cpus(public):2;mem(public):640;ports(public):[7000-7999]"; fi)" &&
DOCKER_NETWORK_OFFSET=0.0.$${N}.0
exec wrapdocker mesos-slave
--work_dir="/var/tmp/mesos/$${N}"
--attributes="rack:$${N};gen:201$${N}"
--hostname=$$(getent hosts mesosslave | cut -d' ' -f1 | sort -u | tail -1)
--resources="cpus:4;mem:1280;disk:25600;ports:[8000-21099]$${PUBLIC_RESOURCES}"
command: []
environment:
- MESOS_MASTER=mesosmaster1:5050
- MESOS_PORT=5051
- MESOS_LOG_DIR=/var/log/mesos
- MESOS_LOGGING_LEVEL=INFO
- MESOS_SWITCH_USER=0
- MESOS_CONTAINERIZERS=docker,mesos
- MESOS_ISOLATION=cgroups/cpu,cgroups/mem
- VAR_LIB_DOCKER_SIZE=10
- DOCKER_DAEMON_ARGS
links:
- etcd
- mesosmaster1
- "ambassador:apiserver"
apiserver:
hostname: apiserver
image: mesosphere/kubernetes-mesos
entrypoint:
- /bin/bash
- "-ceu"
- >
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) &&
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-file "-t=${KUBE_KEYGEN_TIMEOUT}" /var/run/kubernetes/auth/apiserver.crt &&
km apiserver
--address=$$(resolveip apiserver)
--external-hostname=apiserver
--etcd-servers=http://etcd:4001
--port=8888
--admission-control=NamespaceLifecycle,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota
--authorization-mode=AlwaysAllow
--token-auth-file=/var/run/kubernetes/auth/token-users
--basic-auth-file=/var/run/kubernetes/auth/basic-users
--service-account-key-file=/var/run/kubernetes/auth/service-accounts.key
--service-cluster-ip-range=10.10.10.0/24
--service-node-port-range=30000-32767
--cloud-provider=mesos
--cloud-config=/opt/mesos-cloud.conf
--allow-privileged
--tls-cert-file=/var/run/kubernetes/auth/apiserver.crt
--tls-private-key-file=/var/run/kubernetes/auth/apiserver.key
--runtime-config=experimental/v1alpha1
--v=4
ports: [ "8888:8888", "6443:6443" ]
volumes:
- ${MESOS_DOCKER_WORK_DIR}/auth:/var/run/kubernetes/auth:ro
links:
- etcd
- mesosmaster1
controller:
hostname: controller
image: mesosphere/kubernetes-mesos
entrypoint:
- /bin/bash
- "-ceu"
- >
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) &&
await-health-check "-t=${MESOS_DOCKER_MESOS_TIMEOUT}" http://mesosmaster1:5050/health &&
await-health-check "-t=${MESOS_DOCKER_API_TIMEOUT}" http://apiserver:8888/healthz &&
km controller-manager
--address=$$(resolveip controller)
--master=http://apiserver:8888
--cloud-config=/opt/mesos-cloud.conf
--service-account-private-key-file=/var/run/kubernetes/auth/service-accounts.key
--root-ca-file=/var/run/kubernetes/auth/root-ca.crt
--v=4
volumes:
- ${MESOS_DOCKER_WORK_DIR}/auth:/var/run/kubernetes/auth:ro
links:
- mesosmaster1
- apiserver
scheduler:
hostname: scheduler
image: mesosphere/kubernetes-mesos
entrypoint:
- /bin/bash
- "-ceu"
- >
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) &&
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_API_TIMEOUT}" http://apiserver:8888/healthz &&
km scheduler
--address=$$(resolveip scheduler)
--hostname-override=scheduler
--etcd-servers=http://etcd:4001
--mesos-user=root
--api-servers=http://apiserver:8888
--mesos-master=mesosmaster1:5050
--allow-privileged
--cluster-dns=10.10.10.10
--cluster-domain=cluster.local
--mesos-executor-cpus=1.0
--mesos-sandbox-overlay=/opt/sandbox-overlay.tar.gz
--static-pods-config=/opt/static-pods
--mesos-framework-roles=*,public
--mesos-default-pod-roles=*,public
--v=4
--executor-logv=4
--profiling=true
links:
- etcd
- mesosmaster1
- apiserver
volumes:
- ./static-pod.json:/opt/static-pods/static-pod.json
keygen:
image: mesosphere/kubernetes-mesos-keygen
command:
- apiserver
- /var/run/kubernetes/auth
volumes:
- ${MESOS_DOCKER_WORK_DIR}/auth:/var/run/kubernetes/auth
links:
- apiserver