Skip to content

Commit 9f2ae40

Browse files
authored
Merge pull request kubernetes#86154 from droslean/revert-85797-taint-heapster
Revert "Add an option to specify kubelet flags for heapster node."
2 parents 928817a + 00ea8c4 commit 9f2ae40

File tree

2 files changed

+12
-19
lines changed

2 files changed

+12
-19
lines changed

cluster/gce/gci/node-helper.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@
1717
# A library of helper functions and constant for GCI distro
1818
source "${KUBE_ROOT}/cluster/gce/gci/helper.sh"
1919

20-
# shellcheck disable=SC2120
2120
function get-node-instance-metadata-from-file {
22-
local kube_env=${1:-node-kube-env} # optional
2321
local metadata=""
24-
metadata+="kube-env=${KUBE_TEMP}/${kube_env}.yaml,"
22+
metadata+="kube-env=${KUBE_TEMP}/node-kube-env.yaml,"
2523
metadata+="kubelet-config=${KUBE_TEMP}/node-kubelet-config.yaml,"
2624
metadata+="user-data=${KUBE_ROOT}/cluster/gce/gci/node.yaml,"
2725
metadata+="configure-sh=${KUBE_ROOT}/cluster/gce/gci/configure.sh,"

cluster/gce/util.sh

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ function write-master-env {
592592
KUBERNETES_MASTER_NAME="${MASTER_NAME}"
593593
fi
594594

595-
construct-linux-kubelet-flags "master"
595+
construct-linux-kubelet-flags true
596596
build-linux-kube-env true "${KUBE_TEMP}/master-kube-env.yaml"
597597
build-kubelet-config true "linux" "${KUBE_TEMP}/master-kubelet-config.yaml"
598598
build-kube-master-certs "${KUBE_TEMP}/kube-master-certs.yaml"
@@ -603,9 +603,7 @@ function write-linux-node-env {
603603
KUBERNETES_MASTER_NAME="${MASTER_NAME}"
604604
fi
605605

606-
construct-linux-kubelet-flags "heapster"
607-
build-linux-kube-env false "${KUBE_TEMP}/heapster-kube-env.yaml"
608-
construct-linux-kubelet-flags "node"
606+
construct-linux-kubelet-flags false
609607
build-linux-kube-env false "${KUBE_TEMP}/node-kube-env.yaml"
610608
build-kubelet-config false "linux" "${KUBE_TEMP}/node-kubelet-config.yaml"
611609
}
@@ -618,7 +616,7 @@ function write-windows-node-env {
618616
}
619617

620618
function build-linux-node-labels {
621-
local node_type=$1
619+
local master=$1
622620
local node_labels=""
623621
if [[ "${KUBE_PROXY_DAEMONSET:-}" == "true" && "${master}" != "true" ]]; then
624622
# Add kube-proxy daemonset label to node to avoid situation during cluster
@@ -628,10 +626,10 @@ function build-linux-node-labels {
628626
if [[ -n "${NODE_LABELS:-}" ]]; then
629627
node_labels="${node_labels:+${node_labels},}${NODE_LABELS}"
630628
fi
631-
if [[ -n "${NON_MASTER_NODE_LABELS:-}" && "${node_type}" != "master" ]]; then
629+
if [[ -n "${NON_MASTER_NODE_LABELS:-}" && "${master}" != "true" ]]; then
632630
node_labels="${node_labels:+${node_labels},}${NON_MASTER_NODE_LABELS}"
633631
fi
634-
if [[ -n "${MASTER_NODE_LABELS:-}" && "${node_type}" == "master" ]]; then
632+
if [[ -n "${MASTER_NODE_LABELS:-}" && "${master}" == "true" ]]; then
635633
node_labels="${node_labels:+${node_labels},}${MASTER_NODE_LABELS}"
636634
fi
637635
echo $node_labels
@@ -742,7 +740,7 @@ function construct-common-kubelet-flags {
742740
# Sets KUBELET_ARGS with the kubelet flags for Linux nodes.
743741
# $1: if 'true', we're rendering flags for a master, else a node
744742
function construct-linux-kubelet-flags {
745-
local node_type="$1"
743+
local master="$1"
746744
local flags="$(construct-common-kubelet-flags)"
747745
# Keep in sync with CONTAINERIZED_MOUNTER_HOME in configure-helper.sh
748746
flags+=" --experimental-mounter-path=/home/kubernetes/containerized_mounter/mounter"
@@ -753,7 +751,7 @@ function construct-linux-kubelet-flags {
753751
flags+=" --dynamic-config-dir=/var/lib/kubelet/dynamic-config"
754752

755753

756-
if [[ "${node_type}" == "master" ]]; then
754+
if [[ "${master}" == "true" ]]; then
757755
flags+=" ${MASTER_KUBELET_TEST_ARGS:-}"
758756
if [[ "${REGISTER_MASTER_KUBELET:-false}" == "true" ]]; then
759757
#TODO(mikedanese): allow static pods to start before creating a client
@@ -767,17 +765,14 @@ function construct-linux-kubelet-flags {
767765
flags+=" ${NODE_KUBELET_TEST_ARGS:-}"
768766
flags+=" --bootstrap-kubeconfig=/var/lib/kubelet/bootstrap-kubeconfig"
769767
flags+=" --kubeconfig=/var/lib/kubelet/kubeconfig"
770-
if [[ "${node_type}" == "heapster" ]]; then
771-
flags+=" ${HEAPSTER_KUBELET_TEST_ARGS:-}"
772-
fi
773768
fi
774769
# Network plugin
775770
if [[ -n "${NETWORK_PROVIDER:-}" || -n "${NETWORK_POLICY_PROVIDER:-}" ]]; then
776771
flags+=" --cni-bin-dir=/home/kubernetes/bin"
777772
if [[ "${NETWORK_POLICY_PROVIDER:-}" == "calico" || "${ENABLE_NETD:-}" == "true" ]]; then
778773
# Calico uses CNI always.
779774
# Note that network policy won't work for master node.
780-
if [[ "${node_type}" == "master" ]]; then
775+
if [[ "${master}" == "true" ]]; then
781776
flags+=" --network-plugin=${NETWORK_PROVIDER}"
782777
else
783778
flags+=" --network-plugin=cni"
@@ -792,7 +787,7 @@ function construct-linux-kubelet-flags {
792787
flags+=" --non-masquerade-cidr=${NON_MASQUERADE_CIDR}"
793788
fi
794789
flags+=" --volume-plugin-dir=${VOLUME_PLUGIN_DIR}"
795-
local node_labels="$(build-linux-node-labels ${node_type})"
790+
local node_labels="$(build-linux-node-labels ${master})"
796791
if [[ -n "${node_labels:-}" ]]; then
797792
flags+=" --node-labels=${node_labels}"
798793
fi
@@ -1486,7 +1481,7 @@ EOF
14861481
# TODO(kubernetes/autoscaler#718): AUTOSCALER_ENV_VARS is a hotfix for cluster autoscaler,
14871482
# which reads the kube-env to determine the shape of a node and was broken by #60020.
14881483
# This should be removed as soon as a more reliable source of information is available!
1489-
local node_labels="$(build-linux-node-labels node)"
1484+
local node_labels="$(build-linux-node-labels false)"
14901485
local node_taints="${NODE_TAINTS:-}"
14911486
local autoscaler_env_vars="node_labels=${node_labels};node_taints=${node_taints}"
14921487
cat >>$file <<EOF
@@ -3261,7 +3256,7 @@ function create-heapster-node() {
32613256
--tags "${NODE_TAG}" \
32623257
${network} \
32633258
$(get-scope-flags) \
3264-
--metadata-from-file "$(get-node-instance-metadata-from-file "heapster-kube-env")"
3259+
--metadata-from-file "$(get-node-instance-metadata-from-file)"
32653260
}
32663261

32673262
# Assumes:

0 commit comments

Comments
 (0)