Skip to content
This repository was archived by the owner on Dec 5, 2017. It is now read-only.

WIP: v0.7.3 development branch #761

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion images/dcos/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ BUILD_DIR := _build
LOAD_OR_DEFAULT = $(shell cat $(BUILD_DIR)/$(1) 2>/dev/null || echo "$(2)")

# input variables
GIT_REF ?= $(call LOAD_OR_DEFAULT,GIT_REF,v0.7.2-v1.1.5)
GIT_REF ?= $(call LOAD_OR_DEFAULT,GIT_REF,v0.7.3-v1.1.x)
GIT_URL ?= $(call LOAD_OR_DEFAULT,GIT_URL,https://github.com/mesosphere/kubernetes.git)
DOCKER_ORG ?= $(call LOAD_OR_DEFAULT,DOCKER_ORG,mesosphere)
KUBE_ROOT ?= $(call LOAD_OR_DEFAULT,KUBE_ROOT,)
Expand Down
33 changes: 24 additions & 9 deletions images/dcos/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
#!/bin/sh
#
# this bootstrap script is intended to be the startup script for a docker
# container that runs the k8s-mesos framework scheduler that, at this point
# in time, consists of several k8s master processes and possibly an embedded
# etcd server.
#
# it is assumed that this docker container is being executed in BRIDGED mode,
# or at least in a way that isolates the network namespace of this container
# from ths host netns.
#

kubectl=/opt/kubectl

Expand Down Expand Up @@ -119,8 +129,10 @@ kube_master_proxy="http://${apiserver_host}:${apiserver_proxy_port}"

# framework addresses
framework_name=${FRAMEWORK_NAME:-kubernetes}
framework_store_uri=${FRAMEWORK_STORE_URI:-zk://master.mesos:2181/k8sm}
framework_weburi=${FRAMEWORK_WEBURI:-${kube_master_proxy}}
echo "* framework name: $framework_name"
echo "* framework_name: $framework_name"
echo "* framework_store_uri: $framework_store_uri"
echo "* framework_weburi: $framework_weburi"

#
Expand Down Expand Up @@ -227,8 +239,9 @@ prepare_service ${monitor_dir} ${service_dir} apiserver ${APISERVER_RESPAWN_DELA
fdmove -c 2 1
${apply_uids}
/opt/km apiserver
--insecure-bind-address=${host_ip}
--bind-address=${host_ip}
--advertise-address=${host_ip}
--bind-address=0.0.0.0
--insecure-bind-address=0.0.0.0
--cloud-config=${cloud_config}
--cloud-provider=mesos
--etcd-servers=${etcd_server_list}
Expand Down Expand Up @@ -257,14 +270,15 @@ prepare_service ${monitor_dir} ${service_dir} controller-manager ${CONTROLLER_MA
fdmove -c 2 1
${apply_uids}
/opt/km controller-manager
--address=${host_ip}
--address=0.0.0.0
--cloud-config=${cloud_config}
--cloud-provider=mesos
--master=${kube_master}
--port=${controller_manager_port}
--service-account-private-key-file=${controller_service_account_private_key_file}
--root-ca-file=${controller_root_ca_file}
--v=${CONTROLLER_MANAGER_GLOG_v:-${logv}}
--host-port-endpoints=${HOST_PORT_ENDPOINTS:-true}
EOF

# ... after all custom certs/keys have been written to /etc/ssl/overrides
Expand Down Expand Up @@ -292,7 +306,7 @@ kube_context=dcos
#
# nginx, proxying the apiserver and serving kubectl binaries
#
sed "s,<PORT>,${apiserver_proxy_port},;s,<APISERVER>,https://${host_ip}:${apiserver_secure_port},;s,<TOKEN>,${admin_token}," /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf
sed "s,<PORT>,${apiserver_proxy_port},;s,<APISERVER>,https://localhost:${apiserver_secure_port},;s,<TOKEN>,${admin_token}," /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf
prepare_service ${monitor_dir} ${service_dir} nginx ${NGINX_RESPAWN_DELAY:-3} <<EOF
#!/usr/bin/execlineb
fdmove -c 2 1
Expand Down Expand Up @@ -331,8 +345,6 @@ sed -i -e '$i test -f kill && exec s6-svc -d $(pwd) || exec \\' ${service_dir}/k
prepare_kube_dns() {
kube_cluster_dns=${DNS_SERVER_IP:-10.10.10.10}
kube_cluster_domain=${DNS_DOMAIN:-cluster.local}
local kube_nameservers=$(cat /etc/resolv.conf|grep -e ^nameserver|head -3|cut -f2 -d' '|sed -e 's/$/:53/g'|xargs echo -n|tr ' ' ,)
kube_nameservers=${kube_nameservers:-${DNS_NAMESERVERS:-8.8.8.8:53,8.8.4.4:53}}

sed -e "s/{{ pillar\['dns_replicas'\] }}/1/g" \
-e "s,\(command = \"/kube2sky\"\),\\1\\"$'\n'" - --kube_master_url=${kube_master}," \
Expand Down Expand Up @@ -395,7 +407,7 @@ fi

# create dependency service for all services that need apiserver to be started
if [ -n "${apiserver_depends}" ]; then
prepare_service_depends apiserver http://${host_ip}:${apiserver_port}/healthz ok ${apiserver_depends}
prepare_service_depends apiserver http://127.0.0.1:${apiserver_port}/healthz ok ${apiserver_depends}
fi

#
Expand All @@ -409,13 +421,15 @@ prepare_service ${monitor_dir} ${service_dir} scheduler ${SCHEDULER_RESPAWN_DELA
fdmove -c 2 1
${apply_uids}
/opt/km scheduler
--address=${host_ip}
--address=0.0.0.0
--hostname-override=127.0.0.1
--advertised-address=${scheduler_host}:${scheduler_port}
--api-servers=${kube_master}
--driver-port=${scheduler_driver_port}
--service-address=${SCHEDULER_SERVICE_ADDRESS:-10.10.10.9}
--etcd-servers=${etcd_server_list}
--framework-name=${framework_name}
--framework-store-uri=${framework_store_uri}
--framework-weburi=${framework_weburi}
--mesos-master=${mesos_master}
--mesos-user=${K8SM_MESOS_USER:-root}
Expand All @@ -435,6 +449,7 @@ ${apply_uids}
--mesos-default-pod-roles="${SCHEDULER_MESOS_DEFAULT_POD_ROLES:-*}"
--mesos-sandbox-overlay=/opt/sandbox-overlay.tar.gz
--mesos-generate-task-discovery=${SCHEDULER_GENERATE_MESOS_TASK_DISCOVERY:-false}
--host-port-endpoints=${HOST_PORT_ENDPOINTS:-true}
$(if [ -n "${K8SM_FAILOVER_TIMEOUT:-}" ]; then echo "--failover-timeout=${K8SM_FAILOVER_TIMEOUT}"; fi)
$(if [ -n "${kube_cluster_dns}" ]; then echo "--cluster-dns=${kube_cluster_dns}"; fi)
$(if [ -n "${kube_cluster_domain}" ]; then echo "--cluster-domain=${kube_cluster_domain}"; fi)
Expand Down