From d2a3faf325282cf12db6c5667a9c9370465223dd Mon Sep 17 00:00:00 2001 From: Guillermo Calvino Date: Fri, 14 Oct 2022 16:49:13 +0200 Subject: [PATCH] Update OSM tutorial Signed-off-by: Guillermo Calvino --- 20-tutorial.md | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/20-tutorial.md b/20-tutorial.md index 15e785a..c83f12c 100644 --- a/20-tutorial.md +++ b/20-tutorial.md @@ -1,7 +1,7 @@ # OSM installation tutorial ## Introduction -In this tutorial you will install OSM that will be used to deploy and configure a CNF in a K8s cluster. Along the way you will learn how to attach a VIM and a K8s cluster to OSM in order to be able to deploy workloads, and also how VNF packages are uploaded to OSM, so they can be used later on. +In this tutorial you will install OSM that will be used to deploy and configure a CNF in a K8s cluster. Along the way you will attach a VIM and a K8s cluster to OSM in order to be able to deploy workloads, and also upload VNF packages, so they can be used later on. ## Prerequisites @@ -14,7 +14,7 @@ To complete this tutorial you need a fresh [Ubuntu 20.04](https://cloud-images.u ## Install OSM -Download the installation script, and give it executable permissions. Then, install OSM with `--small-profile` option. That will install an OSM version prepared to deploy CNFs only. +We are going to download the installation script, and give it executable permissions. Then, we will install OSM with `--small-profile` option. That will install an OSM version prepared to deploy CNFs only. ```bash wget https://osm-download.etsi.org/ftp/osm-12.0-twelve/install_osm.sh @@ -46,7 +46,7 @@ Track end installation_type: https://osm.etsi.org/InstallLog.php?&installation_i DONE ``` -Now follow the instructions in points 1 and 2 of the installer output. You can copy and paste the commands directly: +Now, to complete the installation, we will follow the instructions in points 1 and 2 of the installer output. We can copy and paste the commands directly: ```bash export OSM_HOSTNAME=nbi.172.21.248.37.nip.io:443 @@ -76,7 +76,7 @@ microk8s.config > microk8s-kubeconfig.yaml --- **NOTE** -If you have just installed Charmed OSM, could be the case that you need to logout and login again in the console, in order to use the `microk8s` command +If you have just installed Charmed OSM, could be the case that you need to logout and login again in the console in order to use the `microk8s` command. --- @@ -86,7 +86,7 @@ And then to attach our microk8s to deploy CNFs: osm k8scluster-add microk8s --creds microk8s-kubeconfig.yaml --vim dummyvim --k8s-nets '{k8s_net1: null}' --version "v1.23" --description="Isolated K8s cluster" ``` -Check the status of the K8scluster with the following command: +You can check the status of the K8scluster with the following command: ```bash $ osm k8scluster-list @@ -98,6 +98,8 @@ $ osm k8scluster-list +----------+--------------------------------------+----------+-------------------+-------------------+ ``` +If you see that the general `operational state` is `ENABLED` and the `operational state` of Helm and Juju are also `ENABLED` then your K8s cluster is ready to be used. + ### Upload the CNF packages to Charmed OSM First we will clone the `osm-packages` repo. In this repo, we can find different examples of VNFs and CNFs that can be deployed with OSM. @@ -116,20 +118,20 @@ osm nspkg-create squid_metrics_cnf_ns ``` -Check that the packages have been successfully uploaded with the following commands: +You can see that the packages have been successfully uploaded if the `squid_cnf` vnf package and the `squid_cnf_ns` network service package are listed when you type the following commands: ```bash $ osm vnfd-list +--------------+--------------------------------------+-----------+ -| nfpkg name   | id                                   | desc type | +| nfpkg name | id | desc type | +--------------+--------------------------------------+-----------+ -| squid_cnf | c1763aa7-209b-45df-9403-63f34eb9ebde | sol006    | +| squid_cnf | c1763aa7-209b-45df-9403-63f34eb9ebde | sol006 | +--------------+--------------------------------------+-----------+ $ osm nsd-list +--------------+--------------------------------------+ -| nsd name    | id                                   | +| nsd name | id | +--------------+--------------------------------------+ | squid_cnf_ns | d99eb544-0415-46cc-a6ef-b78d9c83778d | +--------------+--------------------------------------+ @@ -138,7 +140,7 @@ $ osm nsd-list ### Deploy the CNF -Then instantiate the CNF using this command: +Now that we have all the packages uploaded to OSM, we are going to instantiate the squid proxy using this command: ```bash osm ns-create --ns_name squid --nsd_name squid_cnf_ns --vim_account dummyvim @@ -157,13 +159,15 @@ To get the history of all operations over a NS, run "osm ns-op-list NS_ID" For more details on the current operation, run "osm ns-op-show OPERATION_ID" ``` +You can see that the `ns state` has changed from `BUILDING` to `READY`, and the `current operation` has changed from `INSTANTIATING` to `IDLE`. + ## Testing the CNF and day-2 actions ### Test the squid proxy The squid proxy is configured by default to deny the access to any web page we want to browse. First, we are going to test this behavior. -We need the IP address of our squid: +We need the IP address of our squid that we will use to go through the proxy to Internet. We can get the IP executing the following commands: ```bash # Get squid VNF ID @@ -187,7 +191,7 @@ We will receive an `HTTP 403 - FORBIDDEN` response. ### Allow a url to pass through the proxy -We will use a day-2 action to allow us to navigate to `google.com` url: +So, we saw that our squid proxy will forbid us to navigate to Internet. Now, we want to change its configuration in order to be able to go to `google.com`. For that we will use the following OSM's day-2 action: ```bash $ osm ns-action squid --vnf_name squid_cnf \ @@ -197,7 +201,7 @@ $ osm ns-action squid --vnf_name squid_cnf \ --wait ``` -So then, if we try again (the action could take a couple of minutes until it is completed) we will see that we can navigate to `google.com`: +So then, if we try again (the squid can take a couple of minutes until it is updated with the new configuration) we will see that we can navigate to `google.com`: ```bash $ HTTPS_PROXY=$SQUID_IP:3128 curl https://google.com @@ -208,3 +212,5 @@ The document has moved here. ``` + +OSM allowed us to manage the squid proxy CNF and change its settings to be able to browse `google.com`. \ No newline at end of file -- GitLab