mirror of https://github.com/k3s-io/k3s
Merge pull request #60251 from mikedanese/extra-addons
Automatic merge from submit-queue (batch tested with PRs 60196, 59844, 60255, 60254, 60251). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. gce: allow extra addons to be sourced form a url This will allow istio configs to move out of the repo. Deleting https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/istio will follow shortly. cc @ostromart @MrHohn ```release-note NONE ```pull/6/head
commit
0cb15453da
|
@ -1954,6 +1954,33 @@ function setup-addon-manifests {
|
|||
fi
|
||||
}
|
||||
|
||||
# A function that downloads extra addons from a URL and puts them in the GCI
|
||||
# manifests directory.
|
||||
function download-extra-addons {
|
||||
local -r out_dir="${KUBE_HOME}/kube-manifests/kubernetes/gci-trusty/gce-extras"
|
||||
|
||||
mkdir -p "${out_dir}"
|
||||
|
||||
local curl_cmd=(
|
||||
"curl"
|
||||
"--fail"
|
||||
"--retry" "5"
|
||||
"--retry-delay" "3"
|
||||
"--silent"
|
||||
"--show-error"
|
||||
)
|
||||
if [[ -n "${CURL_RETRY_CONNREFUSED:-}" ]]; then
|
||||
curl_cmd+=("${CURL_RETRY_CONNREFUSED}")
|
||||
fi
|
||||
if [[ -n "${EXTRA_ADDONS_HEADER:-}" ]]; then
|
||||
curl_cmd+=("-H" "${EXTRA_ADDONS_HEADER}")
|
||||
fi
|
||||
curl_cmd+=("-o" "${out_dir}/extras.json")
|
||||
curl_cmd+=("${EXTRA_ADDONS_URL}")
|
||||
|
||||
"${curl_cmd[@]}"
|
||||
}
|
||||
|
||||
# A helper function for copying manifests and setting dir/files
|
||||
# permissions.
|
||||
#
|
||||
|
@ -2245,6 +2272,10 @@ EOF
|
|||
setup-addon-manifests "addons" "istio/noauth"
|
||||
fi
|
||||
fi
|
||||
if [[ -n "${EXTRA_ADDONS_URL:-}" ]]; then
|
||||
download-extra-addons
|
||||
setup-addon-manifests "addons" "gce-extras"
|
||||
fi
|
||||
|
||||
# Place addon manager pod manifest.
|
||||
cp "${src_dir}/kube-addon-manager.yaml" /etc/kubernetes/manifests
|
||||
|
|
Loading…
Reference in New Issue