From c487644f10ae8b2bbd86a612da2300672723b886 Mon Sep 17 00:00:00 2001 From: Andrea Colli-Vignarelli Date: Wed, 3 Apr 2024 12:59:43 +0200 Subject: [PATCH] Fixed multi-provider listing in consumer --- README.md | 6 +++--- docs/installation/installation.md | 2 +- tools/scripts/installation.sh | 15 ++++++++++----- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index ac8961e..dae5104 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ A FLUIDOS node is orchestrated by a single Kubernetes control plane, and it can This repository contains the FLUIDOS Node, along with its essential components, such as: - [**Local ResourceManager**](/docs/implementation/components.md#local-resourcemanager) -- [**Avaialable Resources**](/docs/implementation/components.md#available-resources) +- [**Available Resources**](/docs/implementation/components.md#available-resources) - [**Discovery Manager**](/docs/implementation/components.md#discovery-manager) - [**Peering Candidates**](/docs/implementation/components.md#peering-candidates) - [**REAR Manager**](/docs/implementation/components.md#rear-manager) @@ -23,11 +23,11 @@ Please note that this repository is continually updated, with additional compone ## Implementation -Want to know more about the implementation? Check out the [**Implementation Part**](./docs/implementation/implementation.md). +Want to know more about the implementation? Check out the [**Implementation**](./docs/implementation/implementation.md) section. ## Installation -Want to know how to install a FLUIDOS Node? Check out the [**Installation Part**](./docs/installation/installation.md). +Want to know how to install a FLUIDOS Node? Check out the [**Installation**](./docs/installation/installation.md) section. ## License diff --git a/docs/installation/installation.md b/docs/installation/installation.md index 23a1d10..86738b1 100644 --- a/docs/installation/installation.md +++ b/docs/installation/installation.md @@ -6,7 +6,7 @@ A quick script for installing the FLUIDOS Node is available. Currently, the scri **⚠️ ATTENTION:** The script is currently in an experimental phase, so it may not work as expected. If any issues arise, it may be tricky to understand and terminate the script, as many sub-tasks are executed in the background. We are aware of these issues and are actively working to resolve them. -If you want to use a **working and tested script** to test the FLUIDOS Node, please refer to the [**Testbed**](../testbed/README.md) section. +If you want to use a **working and tested script** to test the FLUIDOS Node within a KinD environment, please refer to the [**Testbed**](../testbed/kind/README.md) section. --- diff --git a/tools/scripts/installation.sh b/tools/scripts/installation.sh index ab0e726..35794ec 100644 --- a/tools/scripts/installation.sh +++ b/tools/scripts/installation.sh @@ -63,6 +63,9 @@ function install_components() { unset clusters declare -A clusters + unset providers_ips + declare -A providers_ips + # Get consumer JSON tmp file from parameter consumers_json=$1 @@ -147,21 +150,23 @@ function install_components() { echo "Cluster role is: $cluster_role" if [ "$provider" != "$cluster" ] && [ "$cluster_role" == "provider" ]; then # Print the specific cluster informations - echo "Cluster: $provider" + echo "Provider cluster: $provider" echo "Value: ${clusters[$provider]}" ip_value="${clusters[$provider]}" ip=$(jq -r '.ip' <<< "$ip_value") # Add the provider port to the IP ip="$ip:$provider_node_port" - if [ -z "${providers_ips[$provider]}" ]; then + if [ -z "${providers_ips[$cluster]}" ]; then providers_ips[$cluster]="$ip" else - providers_ips[$cluster]="${providers_ips[$cluster]},$ip" + providers_ips[$cluster]="${providers_ips[$cluster]}\,$ip" fi fi done + echo "Providers IPs for cluster $cluster: ${providers_ips[$cluster]}" + # Set the KUBECONFIG environment variable taking the value export KUBECONFIG KUBECONFIG=$(echo "${clusters[$cluster]}" | jq -r '.kubeconfig') @@ -218,9 +223,9 @@ function install_components() { --kubeconfig $KUBECONFIG else echo "Installing remote repositories in cluster $cluster with local resource manager" - helm install node fluidos/node -n fluidos --create-namespace -f "$value_file" \ + helm upgrade --install node fluidos/node -n fluidos --create-namespace -f "$value_file" \ --set "networkManager.configMaps.nodeIdentity.ip=$ip:$port" \ - --set "networkManager.configMaps.providers.local=${providers_ips[$cluster]}" \ + --set 'networkManager.configMaps.providers.local'="${providers_ips[$cluster]}" \ --kubeconfig "$KUBECONFIG" fi