Skip to content

SP kubernetes demo

Stefan Schneider edited this page Nov 27, 2019 · 25 revisions

Demo: Kubernetes deployment with the SP

YouTube video: https://youtu.be/69wKTo7CXgM

k8s_deployment

Preparations

  • 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
  • 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 pilot
    • kubectl delete deployment -l sp=sonata
    • kubectl delete svc-l sp=sonata
  • Stop the DT container if it's running: sudo docker stop vnf-dt

Starting point

Show that no packages and no services in the SP: https://pre-int-sp-ath.5gtango.eu/service-platform/packages (login with tango / admin).

Start NS1

This would be usually done once per machine park.

Package and on-board

Instantiate NS1

Access the Prometheus dashboard

  • 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

Start NS2 and the DT

Now, what you would do to connect a new machine in the machine park

Configure and start NS2

  • 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>

Start the digital twin

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

Access the service

Check Prometheus dashboard again

  • Select the DT's em63_actsimpara2 metric -> Execute -> Graph -> reduce time granularity

Accessing the EAE

  • 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

Terminate and clean up