From 87d60d1f51459b92fda1bc1c5e714ab61ac01ad7 Mon Sep 17 00:00:00 2001 From: francesco Date: Tue, 28 Nov 2023 11:47:46 +0100 Subject: [PATCH 1/2] adjusting testbed instructions removing unused file adjusting KUBECONFIG setting in Usage section adding an important note about architecture configuration --- testbed/kind/README.md | 80 ++++++++++++++++++++++++++++-------------- 1 file changed, 53 insertions(+), 27 deletions(-) diff --git a/testbed/kind/README.md b/testbed/kind/README.md index ad44a29..2f0f099 100644 --- a/testbed/kind/README.md +++ b/testbed/kind/README.md @@ -7,7 +7,7 @@ ## Getting Started -This guide will help you to install a FLUIDOS Node **Testbed** using KIND (Kubernetes in Docker). This is the easiest way to install FLUIDOS Node on a local machine. +This guide will help you to install a FLUIDOS Node **Testbed** using KIND (Kubernetes in Docker). This is the easiest way to install FLUIDOS Node on a local machine. This guide has been made only for testing purposes. If you want to install FLUIDOS Node on a production environment, please follow the [official installation guide](/docs/installation/installation.md) @@ -15,55 +15,78 @@ This guide has been made only for testing purposes. If you want to install FLUID This guide will create two different Kubernetes clusters: -* **fluidos-consumer**: This cluster will act as a consumer of the FLUIDOS Node. It will be used to deploy a `solver` example CR which will simulate an Intent resolution request. Through the REAR Protocol it will be able to communicate with the Provider cluster and to receive matching Flavours, reserving the one that best fits the request and purchasing it. +- **fluidos-consumer**: This cluster will act as a consumer of the FLUIDOS Node. It will be used to deploy a `solver` example CR which will simulate an Intent resolution request. Through the REAR Protocol it will be able to communicate with the Provider cluster and to receive matching Flavours, reserving the one that best fits the request and purchasing it. -* **fluidos-provider**: This cluster will act as a provider of the FLUIDOS Node. It will offer its own Flavours on the specific request made by the consumer, reserving and selling it. +- **fluidos-provider**: This cluster will act as a provider of the FLUIDOS Node. It will offer its own Flavours on the specific request made by the consumer, reserving and selling it. ### Prerequisites -* [Docker](https://docs.docker.com/get-docker/) -* [Kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) -* [KIND](https://kind.sigs.k8s.io/docs/user/quick-start/#installation) -* [Helm](https://helm.sh/docs/intro/install/) +- [Docker](https://docs.docker.com/get-docker/) +- [Kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) +- [KIND](https://kind.sigs.k8s.io/docs/user/quick-start/#installation) +- [Helm](https://helm.sh/docs/intro/install/) +- [Liqo CLI tool](https://docs.liqo.io/en/v0.10.1/installation/liqoctl.html) ### Installation -1) Clone the repository +1. Clone the repository ```sh git clone https://github.com/fluidos-project/node.git ``` -2) Move into the KIND Example folder +2. Move into the KIND Example folder ```sh -cd examples/kind +cd testbed/kind ``` -3) Launch the `setup.sh` script +3. Set the execution permission on the `setup.sh` script ```sh -. ./setup.sh +chmod +x setup.sh ``` -4) Wait for the script to finish. It will take some minutes. +3. Launch the `setup.sh` script -5) When the script has finished, you can check the status of the pods with the following command: +```sh + ./setup.sh +``` + +4. Wait for the script to finish. It will take some minutes. + +5. After running the script, you can check the status of the pods in the consumer cluster using the following commands: + +```sh +export KUBECONFIG=consumer/config +kubectl get pods -n fluidos +``` + +To inspect resources within the provider cluster, use the kube configuration file of the provider cluster: ```sh +export KUBECONFIG=provider/config kubectl get pods -n fluidos ``` -6) You should see 3 pods running on the `fluidos-consumer` cluster and 3 pods running on the `fluidos-provider` cluster: +Alternatively, to avoid continuously changing the **KUBECONFIG** environment variable, you can run `kubectl` by explicitly referencing the kube config file: + +```sh +kubectl get pods --kubeconfig "$PWD/consumer/config" --context kind-fluidos-consumer -n fluidos +``` + +This allows for convenient monitoring of both consumer and provider clusters without the need for manual configuration changes. + +6. You should see 3 pods running on the `fluidos-consumer` cluster and 3 pods running on the `fluidos-provider` cluster: -* `node-local-reaource-manager-` -* `node-rear-manager-` -* `node-rear-controller-` +- `node-local-reaource-manager-` +- `node-rear-manager-` +- `node-rear-controller-` -7) You can also check the status of the generated flavours with the following command: +7. You can also check the status of the generated flavours with the following command: ```sh -k get flavours.nodecore.fluidos.eu -n fluidos +kubectl get flavours.nodecore.fluidos.eu -n fluidos ``` The result should be something like this: @@ -78,25 +101,28 @@ NAME PROVIDER ID TYPE CPU Now lets try to deploy a `solver` example CR on the `fluidos-consumer` cluster. -1) Open a new terminal on the repo and move into the `deployments/samples` folder +1. Open a new terminal on the repo and move into the `deployments/node/samples` folder ```sh -cd deployments/samples +cd deployments/node/samples ``` -2) Set the `KUBECONFIG` environment variable to the `fluidos-consumer` cluster +2. Set the `KUBECONFIG` environment variable to the `fluidos-consumer` cluster ```sh -export KUBECONFIG=../../examples/kind/consumer/config +export KUBECONFIG=../../../testbed/kind/consumer/config ``` -3) Deploy the `solver` CR +3. Deploy the `solver` CR ```sh kubectl apply -f solver.yaml ``` -4) Check the result of the deployment +> **Note** +> Please review the **architecture** field and change it to **amd64** or **arm64** according to your local machine architecture. + +4. Check the result of the deployment ```sh kubectl get solver -n fluidos @@ -109,7 +135,7 @@ NAMESPACE NAME INTENT ID FIND CANDIDATE RESERVE AND BUY P fluidos solver-sample intent-sample true true false Solved Solved Solved No need to enstablish a peering 5s ``` -5) Other resources have been created, you can check them with the following commands: +5. Other resources have been created, you can check them with the following commands: ```sh kubectl get flavours.nodecore.fluidos.eu -n fluidos From 6bb39acf20ced723b7d8d3237677860eaef06491 Mon Sep 17 00:00:00 2001 From: Fulvio Risso Date: Thu, 7 Dec 2023 08:06:58 +0100 Subject: [PATCH 2/2] Apply suggestions from code review --- testbed/kind/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/testbed/kind/README.md b/testbed/kind/README.md index 2f0f099..58071d5 100644 --- a/testbed/kind/README.md +++ b/testbed/kind/README.md @@ -7,7 +7,7 @@ ## Getting Started -This guide will help you to install a FLUIDOS Node **Testbed** using KIND (Kubernetes in Docker). This is the easiest way to install FLUIDOS Node on a local machine. +This guide will help you to install a FLUIDOS Node **Testbed** using KIND (Kubernetes in Docker). This is the easiest way to install the FLUIDOS Node on a local machine. This guide has been made only for testing purposes. If you want to install FLUIDOS Node on a production environment, please follow the [official installation guide](/docs/installation/installation.md) @@ -15,9 +15,9 @@ This guide has been made only for testing purposes. If you want to install FLUID This guide will create two different Kubernetes clusters: -- **fluidos-consumer**: This cluster will act as a consumer of the FLUIDOS Node. It will be used to deploy a `solver` example CR which will simulate an Intent resolution request. Through the REAR Protocol it will be able to communicate with the Provider cluster and to receive matching Flavours, reserving the one that best fits the request and purchasing it. +- **fluidos-consumer**: This cluster (a.k.a., FLUIDOS node) will act as a consumer of FLUIDOS resources. It will be used to deploy a `solver` example CR that will simulate an _Intent resolution_ request. This cluster will use the REAR protocol to communicate with the Provider cluster and to receive available Flavours, reserving the one that best fits the request and purchasing it. -- **fluidos-provider**: This cluster will act as a provider of the FLUIDOS Node. It will offer its own Flavours on the specific request made by the consumer, reserving and selling it. +- **fluidos-provider**: This cluster (a.k.a. FLUIDOS node) will act as a provider of FLUIDOS resources. It will offer its own Flavours on the specific request made by the consumer, reserving and selling it. ### Prerequisites @@ -47,15 +47,15 @@ cd testbed/kind chmod +x setup.sh ``` -3. Launch the `setup.sh` script +4. Launch the `setup.sh` script ```sh ./setup.sh ``` -4. Wait for the script to finish. It will take some minutes. +5. Wait for the script to finish. It will take some minutes. -5. After running the script, you can check the status of the pods in the consumer cluster using the following commands: +6. After running the script, you can check the status of the pods in the consumer cluster using the following commands: ```sh export KUBECONFIG=consumer/config