mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Merge pull request #5396 from zmerlynn/conditional_disk
Infer KUBERNETES_MASTER from hostname rather than requiring it to be explicit
This commit is contained in:
commit
983192828a
@ -66,6 +66,13 @@ for k,v in yaml.load(sys.stdin).iteritems():
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Infer master status from presence in node pool
|
||||||
|
if [[ $(hostname) = ${NODE_INSTANCE_PREFIX}* ]]; then
|
||||||
|
KUBERNETES_MASTER="false"
|
||||||
|
else
|
||||||
|
KUBERNETES_MASTER="true"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "${KUBERNETES_MASTER}" == "true" ]]; then
|
if [[ "${KUBERNETES_MASTER}" == "true" ]]; then
|
||||||
# TODO(zmerlynn): This block of code should disappear once #4561 & #4562 are done
|
# TODO(zmerlynn): This block of code should disappear once #4561 & #4562 are done
|
||||||
if [[ -z "${KUBERNETES_NODE_NAMES:-}" ]]; then
|
if [[ -z "${KUBERNETES_NODE_NAMES:-}" ]]; then
|
||||||
|
@ -435,7 +435,6 @@ function build-kube-env {
|
|||||||
rm -f ${file}
|
rm -f ${file}
|
||||||
cat >$file <<EOF
|
cat >$file <<EOF
|
||||||
ENV_TIMESTAMP: $(yaml-quote $(date -uIs))
|
ENV_TIMESTAMP: $(yaml-quote $(date -uIs))
|
||||||
KUBERNETES_MASTER: $(yaml-quote ${master})
|
|
||||||
INSTANCE_PREFIX: $(yaml-quote ${INSTANCE_PREFIX})
|
INSTANCE_PREFIX: $(yaml-quote ${INSTANCE_PREFIX})
|
||||||
NODE_INSTANCE_PREFIX: $(yaml-quote ${NODE_INSTANCE_PREFIX})
|
NODE_INSTANCE_PREFIX: $(yaml-quote ${NODE_INSTANCE_PREFIX})
|
||||||
SERVER_BINARY_TAR_URL: $(yaml-quote ${SERVER_BINARY_TAR_URL})
|
SERVER_BINARY_TAR_URL: $(yaml-quote ${SERVER_BINARY_TAR_URL})
|
||||||
|
Loading…
Reference in New Issue
Block a user