-
Notifications
You must be signed in to change notification settings - Fork 38.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Template the ingress controller #24391
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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]') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe consider this? Your choice. I am okay with python. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah i thought about urandom and in fact my previous commit had /proc/sys/kernel/random/uuid, but neither of those is cross platform. You could argue that python might not be installed, but I grepped our kube-up scripts and it showed that other places were using python so i figured it's the least evil choice. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that @mikedanese is working on removing python for the on-host parts, but maybe it's ok to leave in here. |
||
} | ||
|
||
|
||
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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andyzheng0831 This file is getting templated in preparation for running as a static pod on the master. FYI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for heads-up. I am waiting for this PR to be merged, then I can test my change to gci support