GCI/Trusty: Fix the running of kube-addon-manager

This commit is contained in:
Andy Zheng 2016-05-09 16:00:33 -07:00
parent 8a81000b71
commit d8314b1b9b
3 changed files with 7 additions and 8 deletions

View File

@ -590,8 +590,8 @@ setup_addon_manifests() {
chmod 644 "${dst_dir}"/*
}
# Prepares the manifests of k8s addons static pods.
prepare_kube_addons() {
# Prepares the manifests of k8s addons, and starts the addon manager.
start_kube_addons() {
addon_src_dir="/home/kubernetes/kube-manifests/kubernetes/gci-trusty"
addon_dst_dir="/etc/kubernetes/addons"
# Set up manifests of other addons.
@ -623,7 +623,6 @@ prepare_kube_addons() {
sed -i -e "s@{{ *metrics_memory_per_node *}}@${metrics_memory_per_node}@g" "${controller_yaml}"
sed -i -e "s@{{ *eventer_memory_per_node *}}@${eventer_memory_per_node}@g" "${controller_yaml}"
fi
cp "${addon_src_dir}/namespace.yaml" "${addon_dst_dir}"
if [ "${ENABLE_L7_LOADBALANCING:-}" = "glbc" ]; then
setup_addon_manifests "addons" "cluster-loadbalancing/glbc"
fi

View File

@ -22,18 +22,18 @@
download_kube_env() {
# Fetch kube-env from GCE metadata server.
readonly tmp_install_dir="/var/cache/kubernetes-install"
mkdir -p "${tmp_install_dir}"
readonly tmp_kube_env="/tmp/kube-env.yaml"
curl --fail --retry 5 --retry-delay 3 --silent --show-error \
-H "X-Google-Metadata-Request: True" \
-o "${tmp_install_dir}/kube_env.yaml" \
-o "${tmp_kube_env}" \
http://metadata.google.internal/computeMetadata/v1/instance/attributes/kube-env
# Convert the yaml format file into a shell-style file.
eval $(python -c '''
import pipes,sys,yaml
for k,v in yaml.load(sys.stdin).iteritems():
print("readonly {var}={value}".format(var = k, value = pipes.quote(str(v))))
''' < "${tmp_install_dir}/kube_env.yaml" > /etc/kube-env)
''' < "${tmp_kube_env}" > /etc/kube-env)
rm -f "${tmp_kube_env}"
}
validate_hash() {

View File

@ -177,7 +177,7 @@ script
start_kube_apiserver
start_kube_controller_manager
start_kube_scheduler
prepare_kube_addons
start_kube_addons
end script
--====================================