Skip to content

Commit

Permalink
Merge pull request kubernetes#19241 from mesosphere/karlkfi-docker-cl…
Browse files Browse the repository at this point in the history
…uster

Extract keygen image
  • Loading branch information
alex-mohr committed Jan 21, 2016
2 parents 1ab41d5 + 36f2161 commit 8f0ab67
Show file tree
Hide file tree
Showing 19 changed files with 472 additions and 463 deletions.
2 changes: 1 addition & 1 deletion cluster/mesos/docker/common/bin/await-file
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# Wait for a file to exist in the filesystem.
# Block up to the timeout duration in seconds (default: 10).
# Usage: await-health-check [-t=<duration>] <address>
# Usage: await-file [-t=<duration>] <address>
# Requires: timeout, file

set -o errexit
Expand Down
29 changes: 0 additions & 29 deletions cluster/mesos/docker/common/bin/resolveip

This file was deleted.

169 changes: 0 additions & 169 deletions cluster/mesos/docker/common/bin/util-ssl.sh

This file was deleted.

47 changes: 0 additions & 47 deletions cluster/mesos/docker/common/bin/util-temp-dir.sh

This file was deleted.

34 changes: 7 additions & 27 deletions cluster/mesos/docker/deploy-addons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,39 +27,19 @@ set -o errtrace

KUBE_ROOT=$(cd "$(dirname "${BASH_SOURCE}")/../../.." && pwd)
source "${KUBE_ROOT}/cluster/${KUBERNETES_PROVIDER}/${KUBE_CONFIG_FILE-"config-default.sh"}"
source "${KUBE_ROOT}/cluster/${KUBERNETES_PROVIDER}/common/bin/util-temp-dir.sh"
kubectl="${KUBE_ROOT}/cluster/kubectl.sh"


function deploy_dns {
echo "Deploying DNS Addon" 1>&2
local workspace=$(pwd)

# Process salt pillar templates manually
sed -e "s/{{ pillar\['dns_replicas'\] }}/${DNS_REPLICAS}/g;s/{{ pillar\['dns_domain'\] }}/${DNS_DOMAIN}/g" "${KUBE_ROOT}/cluster/addons/dns/skydns-rc.yaml.in" > "${workspace}/skydns-rc.yaml"
sed -e "s/{{ pillar\['dns_server'\] }}/${DNS_SERVER_IP}/g" "${KUBE_ROOT}/cluster/addons/dns/skydns-svc.yaml.in" > "${workspace}/skydns-svc.yaml"

# Use kubectl to create skydns rc and service
"${kubectl}" create -f "${workspace}/skydns-rc.yaml"
"${kubectl}" create -f "${workspace}/skydns-svc.yaml"
}

function deploy_ui {
echo "Deploying UI Addon" 1>&2

# Use kubectl to create ui rc and service
"${kubectl}" create -f "${KUBE_ROOT}/cluster/addons/kube-ui/kube-ui-rc.yaml"
"${kubectl}" create -f "${KUBE_ROOT}/cluster/addons/kube-ui/kube-ui-svc.yaml"
}
bin="$(cd "$(dirname "${BASH_SOURCE}")" && pwd -P)"

# create the kube-system and static-pods namespaces
"${kubectl}" create -f "${KUBE_ROOT}/cluster/mesos/docker/kube-system-ns.yaml"
"${kubectl}" create -f "${KUBE_ROOT}/cluster/mesos/docker/static-pods-ns.yaml"

if [ "${ENABLE_CLUSTER_DNS}" == true ]; then
cluster::mesos::docker::run_in_temp_dir 'k8sm-dns' 'deploy_dns'
if [ "${ENABLE_CLUSTER_DNS}" == "true" ]; then
echo "Deploying DNS Addon" 1>&2
"${KUBE_ROOT}/third_party/intemp/intemp.sh" -t 'kube-dns' "${bin}/deploy-dns.sh"
fi

if [ "${ENABLE_CLUSTER_UI}" == true ]; then
deploy_ui
if [ "${ENABLE_CLUSTER_UI}" == "true" ]; then
echo "Deploying UI Addon" 1>&2
"${bin}/deploy-ui.sh"
fi
36 changes: 36 additions & 0 deletions cluster/mesos/docker/deploy-dns.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

# Copyright 2016 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Deploy the Kube-DNS addon

set -o errexit
set -o nounset
set -o pipefail
set -o errtrace

KUBE_ROOT=$(cd "$(dirname "${BASH_SOURCE}")/../../.." && pwd)
source "${KUBE_ROOT}/cluster/${KUBERNETES_PROVIDER}/${KUBE_CONFIG_FILE-"config-default.sh"}"
kubectl="${KUBE_ROOT}/cluster/kubectl.sh"

workspace=$(pwd)

# Process salt pillar templates manually
sed -e "s/{{ pillar\['dns_replicas'\] }}/${DNS_REPLICAS}/g;s/{{ pillar\['dns_domain'\] }}/${DNS_DOMAIN}/g" "${KUBE_ROOT}/cluster/addons/dns/skydns-rc.yaml.in" > "${workspace}/skydns-rc.yaml"
sed -e "s/{{ pillar\['dns_server'\] }}/${DNS_SERVER_IP}/g" "${KUBE_ROOT}/cluster/addons/dns/skydns-svc.yaml.in" > "${workspace}/skydns-svc.yaml"

# Use kubectl to create skydns rc and service
"${kubectl}" create -f "${workspace}/skydns-rc.yaml"
"${kubectl}" create -f "${workspace}/skydns-svc.yaml"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright 2015 The Kubernetes Authors All rights reserved.
# Copyright 2016 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -14,19 +14,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Generates root certificate authority crt and key.
# Writes to <out_dir> (use docker volume or docker export to retrieve files).
# Params:
# out_dir - dir to write crt and key to
# Deploy the Kube-UI addon

set -o errexit
set -o nounset
set -o pipefail
set -o errtrace

source "util-ssl.sh"
KUBE_ROOT=$(cd "$(dirname "${BASH_SOURCE}")/../../.." && pwd)
source "${KUBE_ROOT}/cluster/${KUBERNETES_PROVIDER}/${KUBE_CONFIG_FILE-"config-default.sh"}"
kubectl="${KUBE_ROOT}/cluster/kubectl.sh"

out_dir="${1:-}"
[ -z "${out_dir}" ] && echo "No out_dir supplied (param 1)" && exit 1

cluster::mesos::docker::create_root_certificate_authority "${out_dir}"
"${kubectl}" create -f "${KUBE_ROOT}/cluster/addons/kube-ui/kube-ui-rc.yaml"
"${kubectl}" create -f "${KUBE_ROOT}/cluster/addons/kube-ui/kube-ui-svc.yaml"
Loading

0 comments on commit 8f0ab67

Please sign in to comment.