diff --git a/expose_ingress_grpc.sh b/expose_ingress_grpc.sh index 8a4c837406d06ae8971a4d6ab2c5a8ae30cfc87f..e2667247afdf72cc2f48317ace24275408eb11aa 100755 --- a/expose_ingress_grpc.sh +++ b/expose_ingress_grpc.sh @@ -18,7 +18,7 @@ ######################################################################################################################## # If not already set, set the name of the Kubernetes namespace to deploy to. -export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs-dev"} +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} # If not already set, set the list of components you want to build images for, and deploy. export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device automation policy service compute monitoring dbscanserving opticalattackmitigator opticalcentralizedattackdetector webui"} @@ -32,6 +32,7 @@ for COMPONENT in $TFS_COMPONENTS; do echo "Processing '$COMPONENT' component..." SERVICE_GRPC_PORT=$(kubectl get service ${COMPONENT}service --namespace $TFS_K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.name=="grpc")].port}') + echo " '$COMPONENT' service port: $SERVICE_GRPC_PORT" if [ -z "${SERVICE_GRPC_PORT}" ]; then printf "\n" continue; diff --git a/open_dashboard.sh b/scripts/old/open_dashboard.sh similarity index 96% rename from open_dashboard.sh rename to scripts/old/open_dashboard.sh index 8291a22c75cd2c2b83bedcab2ac0167c56c966a6..a3864d2d04c5fb0b3220967f13c324cd554e7963 100755 --- a/open_dashboard.sh +++ b/scripts/old/open_dashboard.sh @@ -16,7 +16,7 @@ # this script opens the dashboard -K8S_NAMESPACE=${K8S_NAMESPACE:-'tf-dev'} +K8S_NAMESPACE=${K8S_NAMESPACE:-'tfs'} GRAFANA_IP=$(kubectl get service/webuiservice -n ${K8S_NAMESPACE} -o jsonpath='{.spec.clusterIP}') GRAFANA_PORT=$(kubectl get service webuiservice-public --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==3000)].nodePort}') diff --git a/open_webui.sh b/scripts/old/open_webui.sh similarity index 70% rename from open_webui.sh rename to scripts/old/open_webui.sh index e4dfdb709ef5008091f3f73357087272dfd7c34e..2d4659bf6080a989774050b7ff36ddb88ba41eae 100755 --- a/open_webui.sh +++ b/scripts/old/open_webui.sh @@ -14,10 +14,9 @@ # this script opens the webui -K8S_NAMESPACE=${K8S_NAMESPACE:-'tf-dev'} +K8S_NAMESPACE=${K8S_NAMESPACE:-'tfs'} -WEBUI_SERVICE_NAME="webuiservice-public" -WEBUI_PROTO=`kubectl get service ${WEBUI_SERVICE_NAME} -n ${K8S_NAMESPACE} -o jsonpath='{.spec.ports[0].name}'` +WEBUI_SERVICE_NAME="webuiservice" WEBUI_IP=`kubectl get service ${WEBUI_SERVICE_NAME} -n ${K8S_NAMESPACE} -o jsonpath='{.spec.clusterIP}'` # WEBUI_PORT=$(kubectl get service ${WEBUI_SERVICE_NAME} --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==8004)].nodePort}') WEBUI_PORT=8004 @@ -25,13 +24,13 @@ WEBUI_PORT=8004 GRAFANA_PORT=3000 # Open WebUI -URL=${WEBUI_PROTO}://${WEBUI_IP}:${WEBUI_PORT} -echo Opening web UI on URL ${URL} -# curl -kL ${URL} -python3 -m webbrowser ${URL} +UI_URL="http://${WEBUI_IP}:${WEBUI_PORT}" +echo "Opening web UI on URL ${UI_URL}" +# curl -kL ${UI_URL} +python3 -m webbrowser ${UI_URL} # Open Dashboard -URL=${WEBUI_PROTO}://${WEBUI_IP}:${GRAFANA_PORT} -echo Opening Dashboard on URL ${URL} -# curl -kL ${URL} -python3 -m webbrowser ${URL} +DASHB_URL="http://${WEBUI_IP}:${GRAFANA_PORT}" +echo "Opening Dashboard on URL ${DASHB_URL}" +# curl -kL ${DASHB_URL} +python3 -m webbrowser ${DASHB_URL} diff --git a/scripts/show_logs_automation.sh b/scripts/show_logs_automation.sh index 8823f29c09960ce980f48d76463682d34e2ea09f..0c0615d9915db6e5b9958ec1205c7a99f096f019 100755 --- a/scripts/show_logs_automation.sh +++ b/scripts/show_logs_automation.sh @@ -18,7 +18,7 @@ ######################################################################################################################## # If not already set, set the name of the Kubernetes namespace to deploy to. -export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs-dev"} +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} ######################################################################################################################## # Automated steps start here diff --git a/scripts/show_logs_compute.sh b/scripts/show_logs_compute.sh index 5e061bb9eb49047b96027a39d3bc846a3e502b5c..759918f11a366450b5c7058a9a2c46bbb701f2cd 100755 --- a/scripts/show_logs_compute.sh +++ b/scripts/show_logs_compute.sh @@ -18,7 +18,7 @@ ######################################################################################################################## # If not already set, set the name of the Kubernetes namespace to deploy to. -export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs-dev"} +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} ######################################################################################################################## # Automated steps start here diff --git a/scripts/show_logs_context.sh b/scripts/show_logs_context.sh index ece545a7e32131880079c2ce65a950c64a16273e..f4b6c620b89d566c8af6950d7240a8286152417d 100755 --- a/scripts/show_logs_context.sh +++ b/scripts/show_logs_context.sh @@ -18,7 +18,7 @@ ######################################################################################################################## # If not already set, set the name of the Kubernetes namespace to deploy to. -export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs-dev"} +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} ######################################################################################################################## # Automated steps start here diff --git a/scripts/show_logs_device.sh b/scripts/show_logs_device.sh index e1c2e4aa8a5fd39e525fcf61ffcf5572e3e6c8d0..d3ef781c92274ecf6b9f2b9ef8eb44b2fde497d6 100755 --- a/scripts/show_logs_device.sh +++ b/scripts/show_logs_device.sh @@ -18,7 +18,7 @@ ######################################################################################################################## # If not already set, set the name of the Kubernetes namespace to deploy to. -export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs-dev"} +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} ######################################################################################################################## # Automated steps start here diff --git a/scripts/show_logs_monitoring.sh b/scripts/show_logs_monitoring.sh index 5978035127735c20ddc6387666a5434cbac61ff8..bd37d0d142f76d532219f1dcdcbd229914d3b0b5 100755 --- a/scripts/show_logs_monitoring.sh +++ b/scripts/show_logs_monitoring.sh @@ -18,7 +18,7 @@ ######################################################################################################################## # If not already set, set the name of the Kubernetes namespace to deploy to. -export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs-dev"} +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} ######################################################################################################################## # Automated steps start here diff --git a/scripts/show_logs_service.sh b/scripts/show_logs_service.sh index 251add7e1641862f3c95dbf038920bc86b3c89ff..6089d0ac6f3008bd5f35e2f813fd1cab2c4d4060 100755 --- a/scripts/show_logs_service.sh +++ b/scripts/show_logs_service.sh @@ -18,7 +18,7 @@ ######################################################################################################################## # If not already set, set the name of the Kubernetes namespace to deploy to. -export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs-dev"} +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} ######################################################################################################################## # Automated steps start here diff --git a/scripts/show_logs_webui.sh b/scripts/show_logs_webui.sh index c73f5f51a6aefe0caee2620cccca272f1abb8622..38cffd624b35ce8196c7bbde2838a0971a7d7024 100755 --- a/scripts/show_logs_webui.sh +++ b/scripts/show_logs_webui.sh @@ -18,7 +18,7 @@ ######################################################################################################################## # If not already set, set the name of the Kubernetes namespace to deploy to. -export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs-dev"} +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} ######################################################################################################################## # Automated steps start here diff --git a/show_deploy.sh b/show_deploy.sh index e894d44f3d7f79ac18ce4f3d5b2708a6402764e6..68a5659aab529be5644015d6e6fbdf9885f7a1ec 100755 --- a/show_deploy.sh +++ b/show_deploy.sh @@ -18,7 +18,7 @@ ######################################################################################################################## # If not already set, set the name of the Kubernetes namespace to deploy to. -export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs-dev"} +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} ######################################################################################################################## # Automated steps start here diff --git a/tutorial/1-2-install-microk8s.md b/tutorial/1-2-install-microk8s.md index 09e0b41a36a9b6c88883377be6c0737157f7afba..327c6af9e477b4edd9b769371f79b32933746af6 100644 --- a/tutorial/1-2-install-microk8s.md +++ b/tutorial/1-2-install-microk8s.md @@ -70,7 +70,16 @@ sudo ufw default allow routed ```bash sudo usermod -a -G docker $USER sudo usermod -a -G microk8s $USER -sudo chown -f -R $USER ~/.kube +sudo chown -f -R $USER $HOME/.kube +sudo reboot +``` + +In case that the .kube file is not automatically provisioned into your home folder, you may follow the steps below: + +```bash +mkdir -p $HOME/.kube +sudo chown -f -R $USER $HOME/.kube +microk8s config > $HOME/.kube/config sudo reboot ``` diff --git a/tutorial/2-1-python-environment.md b/tutorial/2-1-python-environment.md index 4a818e9e7c0a2d4b4ef21ed48d04c84b339046fc..e03e3daff118f8c1f1268d85a215527aab0358b4 100644 --- a/tutorial/2-1-python-environment.md +++ b/tutorial/2-1-python-environment.md @@ -32,6 +32,13 @@ eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)" ``` +In case .bashrc is not linked properly to your profile, you may need to append the following line into your local .profile file: + +```bash +# Open ~/.profile and append this line: ++source "$HOME"/.bashrc +``` + ## 2.1.4. Restart the VM Restart the VM for all the changes to take effect. @@ -58,6 +65,13 @@ pyenv virtualenv 3.9.13 tfs pyenv local 3.9.13/envs/tfs ``` +In case that the correct pyenv does not get automatically activated when you change to the tfs-ctrl/ folder, then execute the following command: + +```bash +cd ~/tfs-ctrl +pyenv activate 3.9.13/envs/tfs +``` + After completing these commands, you should see in your prompt that now you're within the virtual environment `3.9.13/envs/tfs` on folder `~/tfs-ctrl`: ```