-
Notifications
You must be signed in to change notification settings - Fork 17
SP kubernetes demo
YouTube video: https://youtu.be/69wKTo7CXgM
- Connect to VPN
- Use Chrome as browser (SP portal has some bugs in Firefox)
Terminal 1 (local virtualenv):
- Activate virtualenv with Tango SDK tools and
tng-cli
installed - In the terminal with the venv, activate the environment you want to use. For example:
- Pre-int:
export SP_PATH=http://pre-int-sp-ath.5gtango.eu
- Int:
export SP_PATH=http://int-sp-ath.5gtango.eu
- Pre-int:
- Clean the available packages:
tng-cli package -c
Pull the DT's Docker image:
sudo docker pull sonatanfv/vnf-dt:latest
- Check with
kubectl
that there are no deployments or services running of the manufacturing pilotkubectl delete deployment -l sp=sonata
kubectl delete svc-l sp=sonata
- Stop the DT container if it's running:
sudo docker stop vnf-dt
Show that no packages and no services in the SP: https://pre-int-sp-ath.5gtango.eu/service-platform/packages (login with tango
/ admin
).
This would be usually done once per machine park.
- Package NS1 in
sdk-projects
with./pack-ns1-k8s.sh
- On-board with
tng-cli package -u eu.5gtango.tng-smpilot-ns1-k8s.0.1.tgo
- Show that the service is now available in the portal: https://pre-int-sp-ath.5gtango.eu/service-management/network-services/services
- Press "play" in portal: https://pre-int-sp-ath.5gtango.eu/service-management/network-services/services
- Keep other fields empty and use "sm-ns1" as instance name
- Takes a few moments. Continue with explaining workflow.
- Show the request: https://pre-int-sp-ath.5gtango.eu/service-management/requests
- And then the running instance: https://pre-int-sp-ath.5gtango.eu/service-management/network-services/network-service-instances
- Check the CC's floating IP in the portal by clicking the running NS1 instance and then clicking on the CC on the CNF list at the bottom. This should show a list of running containers all with the same floating IP (and internal IP)
- Access the Prometheus GUI at
<floating-ip>:9090
- DT's
em63_actsimpara2
metric not yet available because not yet running
Now, what you would do to connect a new machine in the machine park
-
Package NS2:
./pack-ns2-k8s.sh
-
On-board NS2:
tng-cli package -u eu.5gtango.tng-smpilot-ns2-k8s.0.1.tgo
-
Instantiate NS2 setting the the CC's floating IP as instantiation parameter for NS2 MDC's
MQTT_BROKER_HOST
-
Locally adjust the file
inst_params_ns2.yml
to point to the correct floating IP of NS1 CC -
Click the on-boarded (but not yet instantiated) NS2 service in the portal and copy the service UUID (top left corner)
-
Instantiate NS2 using the instantiation parameters from the file with
tng-cli
:# use -w is for watching the request (leads to blocking until service is running) tng-cli service -n sm-ns2 --params_file inst_params_ns2.yml -i <ns2_service_uuid>
-
The digital twin runs, similar to a real manufacturing machine, outside the Kubernetes deployment. Here, it's deployed as an individual Docker container.
It connects to the MDC's Samba file share, which is exposed via a LoadBalancer
service. The LB's external IP has to be passed to the DT via its variable DT_EM63_SHARE_HOST
when starting it (example here: 10.200.16.20
):
docker run -d --rm -p 15001:15001 --name vnf-dt -e DT_EM63_SHARE_HOST=10.200.16.20 sonatanfv/vnf-dt:latest
Optionally, the DT Python script can be executed directly, without Docker. This requires a) having all requirements in requirements.txt
installed and b) set the env var DT_EM63_SHARE_HOST
before. Then you can run the script with:
python IMMS_APP.py --autostart
- Select the DT's
em63_actsimpara2
metric -> Execute -> Graph -> reduce time granularity
- Check the EAE's external k8s service IP:
kubectl get svc
- Open the browser at
<eae-external-svc-ip>:3000
- Login with
admin
/tango
- Open the data source settings and update the IP address of the Prometheus DB using the CC's IP address
- Access the pre-configured dashboard: Dashboards -> Manage -> Manufacturing Edge Analytics
-
Stop the DT:
sudo docker stop vnf-dt
-
Stop NS2, then NS1 in the portal: https://pre-int-sp-ath.5gtango.eu/service-management/network-service-instances
- If it works by then; else with
kubectl
- If it works by then; else with