Merge pull request #24391 from bprashanth/ing_templated_controller

Automatic merge from submit-queue

Template the ingress controller 

We still need https://github.com/kubernetes/contrib/pull/791 to run the controller as a static pod
ref https://github.com/kubernetes/kubernetes/issues/23663
This commit is contained in:
k8s-merge-robot
2016-05-06 20:04:51 -07:00
5 changed files with 57 additions and 79 deletions

View File

@@ -202,6 +202,16 @@ function gen-kube-bearertoken() {
KUBE_BEARER_TOKEN=$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64 | tr -d "=+/" | dd bs=32 count=1 2>/dev/null)
}
# Generate uid
# This function only works on systems with python. It generates a time based
# UID instead of a UUID because GCE has a name length limit.
#
# Vars set:
# KUBE_UID
function gen-uid {
KUBE_UID=$(python -c 'import uuid; print uuid.uuid1().fields[0]')
}
function load-or-gen-kube-basicauth() {
if [[ ! -z "${KUBE_CONTEXT:-}" ]]; then
@@ -456,6 +466,7 @@ function build-kube-env {
local file=$2
build-runtime-config
gen-uid
rm -f ${file}
cat >$file <<EOF
@@ -503,6 +514,7 @@ KUBE_DOCKER_REGISTRY: $(yaml-quote ${KUBE_DOCKER_REGISTRY:-})
KUBE_ADDON_REGISTRY: $(yaml-quote ${KUBE_ADDON_REGISTRY:-})
MULTIZONE: $(yaml-quote ${MULTIZONE:-})
NON_MASQUERADE_CIDR: $(yaml-quote ${NON_MASQUERADE_CIDR:-})
KUBE_UID: $(yaml-quote ${KUBE_UID:-})
EOF
if [ -n "${KUBELET_PORT:-}" ]; then
cat >>$file <<EOF