Templatize l7 rc

This commit is contained in:
Prashanth Balasubramanian
2016-04-04 17:28:52 -07:00
parent 2ec06f8d4a
commit b066cb5357
4 changed files with 18 additions and 9 deletions

View File

@@ -38,6 +38,7 @@ KUBE_RELEASE_VERSION_REGEX="^v(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*
# kube::release::parse_and_validate_ci_version()
KUBE_CI_VERSION_REGEX="^v(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)-(beta|alpha)\\.(0|[1-9][0-9]*)(\\.(0|[1-9][0-9]*)\\+[-0-9a-z]*)?$"
# Generate kubeconfig data for the created cluster.
# Assumed vars:
# KUBE_USER
@@ -201,13 +202,14 @@ 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 uuid
# This function only works on systems with /proc/sys/kernel/random/uuid.
# 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_UUID
function gen-uuid {
KUBE_UUID=$(cat /proc/sys/kernel/random/uuid)
# KUBE_UID
function gen-uid {
KUBE_UID=$(python -c 'import uuid; print uuid.uuid1().fields[0]')
}
@@ -464,7 +466,7 @@ function build-kube-env {
local file=$2
build-runtime-config
gen-uuid
gen-uid
rm -f ${file}
cat >$file <<EOF
@@ -512,7 +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_UUID: $(yaml-quote ${KUBE_UUID:-})
KUBE_UID: $(yaml-quote ${KUBE_UID:-})
EOF
if [ -n "${KUBELET_PORT:-}" ]; then
cat >>$file <<EOF