3 merge requests!34Merging develop (merged from 2024Q2_RC) into main creating for 2024Q2 Release,!33Merging 2024Q2_RC into main creating for 2024Q2 Release,!29Resolve "Expose all configurable parameters during Kubernetes deployment"
- A Kubernetes cluster up and running with enough disk to allocate about 12GB of PV storage. (Storage requirements can be changed in the respective PV/PVC templates)
- Helm installed for managing Kubernetes packages.
<!--
### Additional Configuration
-**Ingress Controller**: An Nginx ingress controller is required. If you use another type of ingress controller, you'll need to modify `[repo-root]/kubernetes/helm/openslice/templates/openslice-ingress.yaml` to conform to your ingress controller's requirements.
***Kubernetes:** A running cluster where OpenSlice will be deployed.
***Helm:** For managing the deployment of OpenSlice.
***Ingress Controller:** Ingress exposes HTTP and HTTPS routes from outside the cluster to services within the cluster. Traffic routing is controlled by rules defined on the Ingress resource. An Ingress may be configured to give Services externally-reachable URLs, load balance traffic, terminate SSL / TLS, and offer name-based virtual hosting. An Ingress controller is responsible for fulfilling the Ingress, usually with a load balancer, though it may also configure your edge router or additional frontends to help handle the traffic. You must have an Ingress controller to satisfy an Ingress.
* An Nginx ingress controller is required, which can be installed using [this guide](https://docs.nginx.com/nginx-ingress-controller/installation/installing-nic/installation-with-helm/).
* If you use another type of ingress controller, you'll need to modify `[repo-root]/kubernetes/helm/openslice/templates/openslice-ingress.yaml` to conform to your ingress controller's requirements.
***Network Load Balancer:** Required for exposing the service (e.g., GCP, AWS, Azure, MetalLB).
***Domain/IP Address:** Necessary for accessing the application. This should be configured in `[repo-root]/kubernetes/helm/openslice/values.yaml` under `rooturl`.
## Preparing the environment
### 1. Setting Up A Kubernetes Cluster
Refer to the official Kubernetes documentation for setting up a cluster. Ensure your cluster meets the hardware requirements specified above.
### 2. Installing Helm
Helm must be installed on your machine to deploy OpenSlice via Helm charts. Follow the [official Helm installation guide](https://helm.sh/docs/intro/install/).
## Downloading the Project
### 1. Create a New Folder to Download the Project
```bash
mkdir openslice
cd openslice
```
### 2. Download the Project Code
Clone the project code from the GitLab repository.
**Note:** This process will be simplified once the charts are published in the GitLab registry, requiring only the chart to be pulled.
Before deploying the Helm chart, ensure you have configured the necessary components as detailed in the [Configure Helm Chart Services](#configure-helm-chart-services) section. By default, the `main` branch is selected for deployment.
We recommend using:
- The **main** branch for the most stable experience.
- The **develop** branch for access to the latest features. For the develop branch installation, it's strongly advisable to follow the [develop documentation](https://osl.etsi.org/documentation/develop/deployment/).
When deploying OpenSlice with Helm, service configurations are handled through the `values.yaml` file. This file allows you to define all necessary configurations for your deployment, including database credentials, service URLs, and logging levels. Below are examples of how to configure your services in Helm based on your provided values.
### Configuring Services
#### 1. Database Configuration
To configure MySQL and other related services, you can directly set the values in your `values.yaml` file under the `oscreds` and `mysql` sections. For example:
```yaml
oscreds:
mysql:
username:"root"
password:"letmein"
openslicedb:"osdb"
keycloak:
database:"keycloak"
username:"keycloak"
password:"password"
adminpassword:"keycloakadminpass"
portal:
database:"osdb"
username:"portaluser"
password:"12345"
```
#### 2. External Services Configuration
For configuring external services like Bugzilla and CentralLog, specify their URLs and credentials in the `values.yaml` file:
Bugzilla should have the following components under the specified product:
* NSD Deployment Request: Component used to schedule deployment req
* Onboarding: Issues related to VNF/NSD Onboarding
* Operations Support: Default component for operations support
* Validation: Use to track validation processes of VNFs and NSDs
* VPN Credentials/Access: Used for requesting VPN Credentials/Access
Also in the 'Main Site Operations' product, a version named 'unspecified' must be created.
#### 3. Keycloak Configuration
Keycloak settings, including the database and admin password, are part of the `oscreds.mysql.keycloak` section. If you need to adjust Keycloak-specific settings like realms or client configurations, you'll likely need to customize your Helm chart further or manage these settings directly within Keycloak after deployment. The Keycloak realm configuration that is imported by default can be found under `kubernetes/helm/openslice/files/keycloak-init/realm-export.json`.
```yaml
oscreds:
mysql:
keycloak:
database:"keycloak"
username:"keycloak"
password:"password"
adminpassword:"keycloakadminpass"
```
#### 4. Application and Logging Configuration
Application-specific configurations, such as OAuth client secrets and logging levels, can be set in the `spring` section:
```yaml
spring:
oauthClientSecret:"secret"
loglevel:"INFO"
```
#### 5. Ingress and Root URL
To configure the ingress controller and root URL for OpenSlice, update the rooturl field with your ingress load balancer IP or domain. This setting is crucial for external access to your application:
```yaml
rooturl:"http://openslice.com"# Example domain
# or
rooturl:"http://3.15.198.35:8080"# Example IP with port
```
#### 6. Persistent Volume for MySQL
For persistent storage, especially for MySQL, define the storage size under the `mysql` section. This ensures that your database retains data across pod restarts and deployments.
```yaml
mysql:
storage:"10Gi"
```
## Configure Web UI
In folder `kubernetes/helm/openslice/files/org.etsi.osl.portal.web/src/js` edit the `config.js.default` configuration file with your configuration.
> The {BASEURL} placeholder in the file automatically detects the Origin (Protocol://Domain:Port) of the deployment and applies it to every respective property. E.g. If you are attempting a local deployment of Openslice, then {BASEURL} is automatically translated to "http://localhost". Similarly, you may use {BASEURL} to translate to a public deployment configuration, e.g. "https://portal.openslice.io".
If further customization, apart from the default provided, is needed for branding (Logo, Footer) then `config.theming.json` needs to be created in io.openslice.tmf.web/src/assets/config directory, as follows:
```bash
# Starting from the root project directory
cd kubernetes/helm/openslice/files/org.etsi.osl.tmf.web/src/assets/config
If you want to apply changes to the JSON configuration files without the need to rebuild the application, you have to apply the changes at the `org.etsi.osl.tmf.web/dist/io-openslice-portal-web/assets/config` directory. Although, it is <u>mandatory</u> to also apply these changes to the `org.etsi.osl.tmf.web/src/assets/config` for <u>persistancy</u>, as after any future rebuild of OpenSlice the `/dist` directory is being overwritten along with its contents. The OpenSlice team strongly recommends to always apply your changes to the TMF web UI configuration files at `org.etsi.osl.tmf.web/src/assets/config` and rebuild the application.
### 3. Deploy the Helm Chart
After configuring the services, and editing the docker compose file accordingly, the docker compose instantiation command can be performed.
## Validating deployments and container monitoring
In a Kubernetes environment, you can monitor the status of your deployments and containers using `kubectl`, the Kubernetes command-line tool, which provides powerful capabilities for inspecting the state of resources in your cluster.
## Post installation steps
After the successful deployment of OpenSlice, to ensure the E2E user experience, **this section is mandatory**. It contains crucial configuration in regard of authentication and user creation.
### Checking the Status of your application's deployment
To check the status of your deployment, use the following commands. The output should be similar:
```bash
kubectl get pods -n openslice -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
If a pod is not in the expected state, you can access its logs for troubleshooting:
```bash
kubectl logs <pod-name> -n openslice
```
### Configure Keycloak server
The Keycloack server is managing authentication and running on a container at port 8080. It is also proxied to your host via the ingress resource under http://<your-domain>/auth.
- Navigate to http://<your-domain>/auth/ or https://<your-domain>/auth/, (http://ipaddress:8080/auth/ or https://ipaddress:8443/auth/ which are directly accessible without proxy)
- Navigate to Administration Console
- Login with the credentials from section [Keycloak Configuration](#3-keycloak-configuration). Default values are:
- user: admin
- password: KEYCLOAK_PASSWORD
> if you are running in HTTP you will get a message: HTTPS required.
To resolve this issue <u>when running in HTTP</u>:
- Select the master realm from top left corner
- Go to login Tab and select "Require SSL": None
- Repeat for realm Openslice
> If you are running in HTTPS, then "Require SSL" can be left unchanged to external requests.
#### 1. Configure redirects
Navigate to realm Openslice > client > osapiWebClientId and change the Root URL to your domain.
Also, insert your domain, e.g. http://example.org/*, at:
* Valid Redirect URIs
* Web Origins
#### 2. Configure email
Keycloak allows new users to register. Subsequently, this will also allow new users to register to the OpenSlice portal.
On Tab Login > check User registration, Verify email, Forgot password etc.
Also, enter the details on Realm > Email > Enable Authentication.
#### 3. Add an OpenSlice admin user
This step is mandatory so as to access the OpenSlice Web UI. To add an OpenSlice admin user you must:
- Navigate to manage/users and add an OpenSlice admin user, e.g. username=admin.
- Set a password
- Navigate to Role Mappings and add ADMIN and MENTOR to Assigned Roles.
> That user is different from the Keycloak admin user. It is required to login and browse the OpenSlice Web UI. The Roles ADMIN and MENTOR guarantee full access through the Openslice UI, thus such a user is always required.
***IMPORTANT: The following is not currently supported in Kubernetes installation.**
### Keycloak at localhost
> **This is an important step if you run Keycloak on localhost!**
1 - Edit your Hosts File, adding the line below
```127.0.0.1 keycloak```
Hosts File Location:
- In Linux/Unix, the file's location is at /etc/hosts
- In Windows, its location is at c:\Windows\System32\Drivers\etc\hosts
2 - Replace http://localhost/auth/ with http://keycloak:8080/auth/ in your Keycloak config for AngularJS and Angular (see examples below).
> Explanation
Nginx uses the http://keycloak:8080 URL, which is accessible via the internal docker system's network.
The Front-end (TS/Angular) shall also use the http://keycloak:8080.
This way, you will not get the invalid token error, as the API is acquiring the token from http://keycloak:8080 (internally) and the Front-end is getting verified by an issuer at the same URL, as well.
2.1 - For the Angular configuration (TMF portal UI), navigate to org.etsi.osl.tmf.web/src/assets/config and edit config.prod.json
```bash
# Starting from the root project directory
cd org.etsi.osl.tmf.web/src/assets/config
```
```bash
nano config.prod.json
```
After editing it should look like the example bellow:
> Note the difference in changing {BASEURL} -> http://keycloak:8080
> If you want the changes to take place immediately without rebuilding the project, then repeat the process for org.etsi.osl.tmf.web/dist/org.etsi.osl.tmf.web/assets/config/config.prod.json
2.2 - For the AngularJS configuration (NVF portal UI), navigate to org.etsi.osl.portal.web/src/js and edit config.js
```bash
# Starting from the root project directory
cd org.etsi.osl.portal.web/src/js
```
```bash
nano config.js
```
after editing it should look like the example bellow:
```
var appConfig = angular.module('portalwebapp.config',[]);
After successfully deploying and configuring OpenSlice, you may configure its environment (e.g. the NFVO) that will facilitate the deployment of NFV artifacts.
See [NFV Orchestrator Configuration](./nfvoconfig.md).