mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 06:54:01 +00:00
Make join cluster function in federation-up.sh a little more succinct.
This commit is contained in:
parent
48d7842211
commit
ceb88b3869
@ -60,7 +60,7 @@ HOST_CLUSTER_CONTEXT="${FEDERATION_HOST_CLUSTER_CONTEXT:-${1}}"
|
||||
|
||||
# kube-dns configuration.
|
||||
KUBEDNS_CONFIGMAP_NAME="kube-dns"
|
||||
KUBEDNS_CONFIGMAP_NAMESPACE = "kube-system"
|
||||
KUBEDNS_CONFIGMAP_NAMESPACE="kube-system"
|
||||
KUBEDNS_FEDERATION_FLAG="federations"
|
||||
|
||||
host_kubectl="${KUBE_ROOT}/cluster/kubectl.sh --namespace=${FEDERATION_NAMESPACE}"
|
||||
|
@ -87,9 +87,9 @@ function init() {
|
||||
--image="${kube_registry}/hyperkube-amd64:${kube_version}"
|
||||
}
|
||||
|
||||
# join_cluster_to_federation joins the clusters in the local kubeconfig to federation. The clusters
|
||||
# join_clusters joins the clusters in the local kubeconfig to federation. The clusters
|
||||
# and their kubeconfig entries in the local kubeconfig are created while deploying clusters, i.e. when kube-up is run.
|
||||
function join_cluster_to_federation() {
|
||||
function join_clusters() {
|
||||
for cluster in $("${KUBE_ROOT}/cluster/kubectl.sh" config get-clusters |sed -n '1!p'); do
|
||||
# Skip federation context
|
||||
if [[ "${cluster}" == "${FEDERATION_NAME}" ]]; then
|
||||
@ -114,8 +114,7 @@ USE_KUBEFED="${USE_KUBEFED:-}"
|
||||
|
||||
if [[ "${USE_KUBEFED}" == "true" ]]; then
|
||||
init
|
||||
|
||||
join_cluster_to_federation
|
||||
join_clusters
|
||||
else
|
||||
export FEDERATION_IMAGE_TAG="$(get_version)"
|
||||
create-federation-api-objects
|
||||
|
Loading…
Reference in New Issue
Block a user