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