Skip to content

Commit

Permalink
Fixed multi-provider listing in consumer
Browse files Browse the repository at this point in the history
  • Loading branch information
andreacv98 committed Apr 9, 2024
1 parent 9bcd4c1 commit c487644
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/installation/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

---

Expand Down
15 changes: 10 additions & 5 deletions tools/scripts/installation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit c487644

Please sign in to comment.