@@ -592,7 +592,7 @@ function write-master-env {
592
592
KUBERNETES_MASTER_NAME=" ${MASTER_NAME} "
593
593
fi
594
594
595
- construct-linux-kubelet-flags " master "
595
+ construct-linux-kubelet-flags true
596
596
build-linux-kube-env true " ${KUBE_TEMP} /master-kube-env.yaml"
597
597
build-kubelet-config true " linux" " ${KUBE_TEMP} /master-kubelet-config.yaml"
598
598
build-kube-master-certs " ${KUBE_TEMP} /kube-master-certs.yaml"
@@ -603,9 +603,7 @@ function write-linux-node-env {
603
603
KUBERNETES_MASTER_NAME=" ${MASTER_NAME} "
604
604
fi
605
605
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
609
607
build-linux-kube-env false " ${KUBE_TEMP} /node-kube-env.yaml"
610
608
build-kubelet-config false " linux" " ${KUBE_TEMP} /node-kubelet-config.yaml"
611
609
}
@@ -618,7 +616,7 @@ function write-windows-node-env {
618
616
}
619
617
620
618
function build-linux-node-labels {
621
- local node_type =$1
619
+ local master =$1
622
620
local node_labels=" "
623
621
if [[ " ${KUBE_PROXY_DAEMONSET:- } " == " true" && " ${master} " != " true" ]]; then
624
622
# Add kube-proxy daemonset label to node to avoid situation during cluster
@@ -628,10 +626,10 @@ function build-linux-node-labels {
628
626
if [[ -n " ${NODE_LABELS:- } " ]]; then
629
627
node_labels=" ${node_labels: +${node_labels} ,}${NODE_LABELS} "
630
628
fi
631
- if [[ -n " ${NON_MASTER_NODE_LABELS:- } " && " ${node_type } " != " master " ]]; then
629
+ if [[ -n " ${NON_MASTER_NODE_LABELS:- } " && " ${master } " != " true " ]]; then
632
630
node_labels=" ${node_labels: +${node_labels} ,}${NON_MASTER_NODE_LABELS} "
633
631
fi
634
- if [[ -n " ${MASTER_NODE_LABELS:- } " && " ${node_type } " == " master " ]]; then
632
+ if [[ -n " ${MASTER_NODE_LABELS:- } " && " ${master } " == " true " ]]; then
635
633
node_labels=" ${node_labels: +${node_labels} ,}${MASTER_NODE_LABELS} "
636
634
fi
637
635
echo $node_labels
@@ -742,7 +740,7 @@ function construct-common-kubelet-flags {
742
740
# Sets KUBELET_ARGS with the kubelet flags for Linux nodes.
743
741
# $1: if 'true', we're rendering flags for a master, else a node
744
742
function construct-linux-kubelet-flags {
745
- local node_type =" $1 "
743
+ local master =" $1 "
746
744
local flags=" $( construct-common-kubelet-flags) "
747
745
# Keep in sync with CONTAINERIZED_MOUNTER_HOME in configure-helper.sh
748
746
flags+=" --experimental-mounter-path=/home/kubernetes/containerized_mounter/mounter"
@@ -753,7 +751,7 @@ function construct-linux-kubelet-flags {
753
751
flags+=" --dynamic-config-dir=/var/lib/kubelet/dynamic-config"
754
752
755
753
756
- if [[ " ${node_type } " == " master " ]]; then
754
+ if [[ " ${master } " == " true " ]]; then
757
755
flags+=" ${MASTER_KUBELET_TEST_ARGS:- } "
758
756
if [[ " ${REGISTER_MASTER_KUBELET:- false} " == " true" ]]; then
759
757
# TODO(mikedanese): allow static pods to start before creating a client
@@ -767,17 +765,14 @@ function construct-linux-kubelet-flags {
767
765
flags+=" ${NODE_KUBELET_TEST_ARGS:- } "
768
766
flags+=" --bootstrap-kubeconfig=/var/lib/kubelet/bootstrap-kubeconfig"
769
767
flags+=" --kubeconfig=/var/lib/kubelet/kubeconfig"
770
- if [[ " ${node_type} " == " heapster" ]]; then
771
- flags+=" ${HEAPSTER_KUBELET_TEST_ARGS:- } "
772
- fi
773
768
fi
774
769
# Network plugin
775
770
if [[ -n " ${NETWORK_PROVIDER:- } " || -n " ${NETWORK_POLICY_PROVIDER:- } " ]]; then
776
771
flags+=" --cni-bin-dir=/home/kubernetes/bin"
777
772
if [[ " ${NETWORK_POLICY_PROVIDER:- } " == " calico" || " ${ENABLE_NETD:- } " == " true" ]]; then
778
773
# Calico uses CNI always.
779
774
# Note that network policy won't work for master node.
780
- if [[ " ${node_type } " == " master " ]]; then
775
+ if [[ " ${master } " == " true " ]]; then
781
776
flags+=" --network-plugin=${NETWORK_PROVIDER} "
782
777
else
783
778
flags+=" --network-plugin=cni"
@@ -792,7 +787,7 @@ function construct-linux-kubelet-flags {
792
787
flags+=" --non-masquerade-cidr=${NON_MASQUERADE_CIDR} "
793
788
fi
794
789
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 } ) "
796
791
if [[ -n " ${node_labels:- } " ]]; then
797
792
flags+=" --node-labels=${node_labels} "
798
793
fi
@@ -1486,7 +1481,7 @@ EOF
1486
1481
# TODO(kubernetes/autoscaler#718): AUTOSCALER_ENV_VARS is a hotfix for cluster autoscaler,
1487
1482
# which reads the kube-env to determine the shape of a node and was broken by #60020.
1488
1483
# 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 ) "
1490
1485
local node_taints=" ${NODE_TAINTS:- } "
1491
1486
local autoscaler_env_vars=" node_labels=${node_labels} ;node_taints=${node_taints} "
1492
1487
cat >> $file << EOF
@@ -3261,7 +3256,7 @@ function create-heapster-node() {
3261
3256
--tags " ${NODE_TAG} " \
3262
3257
${network} \
3263
3258
$( 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) "
3265
3260
}
3266
3261
3267
3262
# Assumes:
0 commit comments