...
Code Block | ||
---|---|---|
| ||
git clone "https://gerrit.o-ran-sc.org/r/nonrtric/rapp/orufhrecovery" git checkout f-release --track origin/f-release cd orucfronthaulrecovery/scriptversion/helm/sdnr-simulator/ helm package . helm install sdnr-simulator sdnr-simulator-0.1.0.tgz --set image.repository=registry.nordix.org/onap/sdnr-simulator --set image.tag=1.01.0 --set messagerouter.host="http://message-router.onap" --set messagerouter.port="3904" --namespace nonrtric --create-namespace --wait |
...
The logs of the sdnr-simulator should show that a PUT request has been successfully received.
"PUT /rests/data/network-topology:network-topology/topology=topology-netconf/node=HCL-O-DU-1123/yang-ext:mount/o-ran-sc-du-hello-world:network-function/dudistributed-tounit-ru-connectionfunctions=ERICSSON-O-RU-11225/radio-resource-management-policy-ratio=rrm-pol-1 HTTP/1.1" 200200
b) Control loop for script version
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
tosca_definitions_version: tosca_simple_yaml_1_1_03 data_types: onap.datatypes.ToscaConceptIdentifier: derived_from: tosca.datatypes.Root properties: name: type: string required: true version: type: string required: true node_types: org.onap.policy.clamp.controlloopacm.Participant: version: 1.0.1 derived_from: tosca.nodetypes.Root properties: provider: type: string requred: false org.onap.policy.clamp.controlloopacm.ControlLoopAutomationCompositionElement: version: 1.0.1 derived_from: tosca.nodetypes.Root properties: provider: type: string requredrequired: false elementsmetadata: typecommon: listtrue required: true description: Specifies the organization that provides the automation composition element entryparticipant_schemaid: type: onap.datatypes.ToscaConceptIdentifier org.onap.policy.clamp.controlloop.ControlLoopElement: version: 1.0.1 derived_from: tosca.nodetypes.Root properties: requred: true providermetadata: type: string requredcommon: falsetrue participant_idparticipantType: type: onap.datatypes.ToscaConceptIdentifier requredrequired: true org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement: versionmetadata: 1.0.1 derived_from: org.onap.policy.clamp.controlloop.ControlLoopElement propertiescommon: true chart: description: The identity of the participant type: string that hosts this type of Automation Composition required: trueElement configsstartPhase: type: listinteger required: false requirementsconstraints: - typegreater_or_equal: string0 requredmetadata: false templates: typecommon: listtrue requireddescription: false A value indicating the start phase in which entry_schema: this automation composition element will values: be started, the type: string requred: true topology_template: node_templates: first start phase is zero. Automation Composition Elements are started in their start_phase order and stopped org.onap.domain.linkmonitor.LinkMonitorControlLoopDefinition1: version: 1.2.3 type: org.onap.policy.clamp.controlloop.ControlLoop type_version: 1.0.1in reverse start phase order. Automation Composition Elements with the same start phase are started and description: Control loop for Linkstopped Monitorsimultaneously propertiesuninitializedToPassiveTimeout: providertype: Ericssoninteger elementsrequired: false - name: org.onap.domain.linkmonitor.OruAppK8SMicroserviceControlLoopElementconstraints: version- greater_or_equal: 1.2.30 - namedefault: org.onap.domain.linkmonitor.MessageGeneratorK8SMicroserviceControlLoopElement60 versionmetadata: 1.2.3 - namecommon: org.onap.domain.linkmonitor.SdnrSimulatorK8SMicroserviceControlLoopElement true description: The maximum version: 1.2.3 org.onap.k8s.controlloop.K8SControlLoopParticipant: version: 2.3.4time in seconds to wait for a state chage from uninitialized to passive typepassiveToRunningTimeout: org.onap.policy.clamp.controlloop.Participant type_version: 1.0.1: integer description required: Participantfalse for k8s propertiesconstraints: - providergreater_or_equal: ONAP0 org.onap.domain.linkmonitor.OruAppK8SMicroserviceControlLoopElement: default: 60 versionmetadata: 1.2.3 typecommon: org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement true type_versiondescription: 1.0.1 description: Control loop element for oru-app The maximum time in seconds to wait for a state chage from passive to running propertiesrunningToPassiveTimeout: providertype: ONAPinteger participant_idrequired: false nameconstraints: K8sParticipant0 version- greater_or_equal: 1.0.0 participantTypedefault: 60 name: org.onap.k8s.controlloop.K8SControlLoopParticipantmetadata: versioncommon: 2.3.4true chartdescription: The maximum time in seconds to wait for a chartId: state chage from running to passive name: oru-apppassiveToUninitializedTimeout: type: integer version: 0.1.0 required: false releaseName: oru-app constraints: repository: - greater_or_equal: 0 repoNamedefault: chartmuseum60 namespacemetadata: nonrtric overrideParamscommon: true description: The maximum time image.repository: nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-o-ru-closed-loop-recovery image.tagin seconds to wait for a state chage from passive to uninitialized org.onap.policy.clamp.acm.AutomationComposition: version: 1.0.1 messagerouter.host: http://message-router.onapderived_from: tosca.nodetypes.Root properties: messagerouter.port: 3904provider: sdnr.hosttype: http://sdnr-simulatorstring required: false sdnr.port: 9990 org.onap.domain.linkmonitor.MessageGeneratorK8SMicroserviceControlLoopElementmetadata: version: 1.2.3 common: true type: org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement type_versiondescription: 1.0.1 description: Control loop element for message-generatorSpecifies the organization that provides the automation composition element propertieselements: providertype: ONAPlist participant_idrequired: true namemetadata: K8sParticipant0 versioncommon: 1.0.0true participantTypeentry_schema: nametype: org.onap.k8sdatatypes.controlloop.K8SControlLoopParticipantToscaConceptIdentifier versiondescription: 2.3.4 chart: chartIdSpecifies a list of automation composition element definitions that make up this automation composition definition org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement: version: 1.0.1 derived_from: org.onap.policy.clamp.acm.AutomationCompositionElement nameproperties: message-generator chart: versiontype: 0.1.0string releaseNamerequired: message-generatortrue configs: repository: type: list repoNamerequired: chartmuseumfalse requirements: namespacetype: nonrtricstring requred: false overrideParams: templates: image.repositorytype: registry.nordix.org/onap/message-generator list required: false image.tag: 1.0.0 entry_schema: values: messagerouter.host: http://message-router.onap type: string requred: true topology_template: messagerouter.port: 3904node_templates: org.onap.policy.domainclamp.linkmonitoracm.SdnrSimulatorK8SMicroserviceControlLoopElementKubernetesParticipant: version: 1.2.3.4 type: org.onap.policy.clamp.controlloopacm.K8SMicroserviceControlLoopElementParticipant type_version: 1.0.1 description: Control loop elementParticipant for sdnr-simulatorK8S properties: provider: ONAPEricsson participant_idorg.onap.domain.linkmonitor.OruAppK8SMicroserviceAutomationCompositionElement: # Chart from new name: K8sParticipant0 repository version: 1.02.03 participantType:type: org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement type_version: 1.0.0 description: Automation composition element for the K8S microservice for PMSH properties: provider: ONAP participant_id: name: K8sParticipant0 version: 1.0.0 participantType: name: org.onap.policy.k8sclamp.controlloopacm.K8SControlLoopParticipantKubernetesParticipant version: 2.3.4 chart: chartId: name: sdnroru-simulatorapp version: 0.1.0 releaseName: sdnroru-simulatorapp repository: repoName: chartmuseumrepoName: nginx-proxy address: https://nginx-proxy:443 namespace: nonrtric overrideParams: image.repository: registry.nordixnexus3.o-ran-sc.org/onap/sdnr-simulator:10004/o-ran-sc/nonrtric-rapp-orufhrecovery image.tag: 1.01.0 messagerouter.host: http://message-router.onap messagerouter.port: 3904 sdnr.host: http://sdnr-simulator sdnr.port: 9990 org.onap.domain.linkmonitor.MessageGeneratorK8SMicroserviceAutomationCompositionElement: # Chart from new repository version: 1.2.3 type: org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement type_version: 1.0.0 description: Automation composition element for the K8S microservice for PMSH properties: provider: ONAP participant_id: name: K8sParticipant0 version: 1.0.0 participantType: name: org.onap.policy.clamp.acm.KubernetesParticipant version: 2.3.4 chart: chartId: name: message-generator version: 0.1.0 releaseName: message-generator repository: repoName: nginx-proxy address: https://nginx-proxy:443 namespace: nonrtric overrideParams: image.repository: registry.nordix.org/onap/message-generator image.tag: 1.0.0 messagerouter.host: http://message-router.onap messagerouter.port: 3904 org.onap.domain.linkmonitor.SdnrSimulatorK8SK8SMicroserviceAutomationCompositionElement: # Chart from new repository version: 1.2.3 type: org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement type_version: 1.0.0 description: Automation composition element for the K8S microservice for PMSH properties: provider: ONAP participant_id: name: K8sParticipant0 version: 1.0.0 participantType: name: org.onap.policy.clamp.acm.KubernetesParticipant version: 2.3.4 chart: chartId: name: sdnr-simulator version: 0.1.0 releaseName: sdnr-simulator repository: repoName: nginx-proxy address: https://nginx-proxy:443 namespace: nonrtric overrideParams: image.repository: registry.nordix.org/onap/sdnr-simulator image.tag: 1.1.0 messagerouter.host: http://message-router.onap messagerouter.port: 3904 org.onap.domain.sample.GenericK8s_AutomationCompositionDefinition: version: 1.2.3 type: org.onap.policy.clamp.acm.AutomationComposition type_version: 1.0.1 description: Automation composition for Hello World properties: provider: ONAP elements: - name: org.onap.domain.linkmonitor.OruAppK8SMicroserviceAutomationCompositionElement version: 1.2.3 - name: org.onap.domain.linkmonitor.MessageGeneratorK8SMicroserviceAutomationCompositionElement version: 1.2.3 - name: org.onap.domain.linkmonitor.SdnrSimulatorK8SK8SMicroserviceAutomationCompositionElement version: 1.2.3 |
This control loop will bring up three micro-services in the nonrtric namespace: oru-app (running the actual logic of the usecase), message-generator (sending the LinkFailure messages at random intervals), and sdnr-simulator (This control loop will bring up three micro-services in the nonrtric namespace: oru-app (running the actual logic of the usecase), message-generator (sending the LinkFailure messages at random intervals), and sdnr-simulator (for receiving the REST calls made by oru-app). Make sure that the sdnr-simulator is not already running in the nonrtric namespace, otherwise the control loop instantiation might fail.
...
Code Block | ||
---|---|---|
| ||
kubectl -n onap get pod | grep k8s-ppnt |
Log into the k8s-ppnt pod and create the following directories
Code Block | ||
---|---|---|
| ||
mkdir -p ~/.kube
mkdir ~/ssl |
Copy the config file using this command:
...
Code Block | ||
---|---|---|
| ||
cd orufhrecovery/scriptversion/helm/sdnr-simulator/ helm package . kubectl cp ./sdnr-simulator-0.1.0.tgz onap/<POD-NAME-k8s-ppnt>:/home/policy/local-charts/sdnr-simulator-simulator-0.1.0.tgz cd orufhrecovery/scriptversion/helm/message-generator/ helm package . kubectl cp ./message-generator-0.1.0.tgz onap/<POD-NAME-k8s-ppnt>:/home/policy/local-charts/message-generator-0.1.0.tgz cd orufhrecovery/scriptversion/helm/messageoru-generatorapp/ helm package . kubectl cp ./messageoru-generatorapp-0.1.0.tgz onap/<POD-NAME-k8s-ppnt>:/home/policy/local-charts/message-generatororu-app-0.1.0.tgz |
- Finally, create tls-certs using onap cet manager kubectl apply -f certificate.yaml (Replace NodeIP with your control plane IP)
- Install the nginx proxy to run in front of ONAP chartmuseum: kubectl apply -f nginx.yaml
- Retrieve chartmuseum username and password using kubectl get secret onap-chartmuseum-registrycred -o=go-template='{{$login := .data.login| base64decode}}{{$pw := .data.password| base64decode}}{{printf "%s:%s" $login $pw }}'
- Push the charts to chartmuseum e.g. curl -u <username>:<password> --data-binary "@sdnr-simulator-0.1.0.tgz
...
- " http://172.16.2.85:30088/api/charts
- Retrieve the ca.crt from the secret and copy it to the k8s-ppnt pod :
Code Block language bash kubectl get secret nginx-tls -o jsonpath="{.data.ca\.crt}" | base64 -d > ca.crt cp ~/certs/ca.crt onap/${K8S_PPNT_POD}:/home/policy/ssl
- Log into the k8s-ppnt Finally, install chartmuseum into the kubernetes-participant and push the above helm charts into it. Get into the pod using "kubectl -n onap exec -it <POD-NAME-k8s-ppnt> sh" and run the following commands:
Code Block | ||
---|---|---|
| ||
mkdir -p ~/helm3-storage curl -LO https://s3.amazonaws.com/chartmuseum/release/latest/bin/linux/amd64/chartmuseum chmod +x ./chartmuseum ./chartmuseum --storage local --storage-local-rootdir /home/policy/helm3-storage -port 8080 & curl --data-binary "@local-charts/sdnr-simulator-0.1.0.tgz" http://localhost:8080/api/charts curl --data-binary "@local-charts/message-generator-0.1.0.tgz" http://localhost:8080/api/charts curl --data-binary "@local-charts/oru-app-0.1.0.tgz" http://localhost:8080/api/charts helm repo add chartmuseum http://localhost:8080.kube mkdir ~/ssl helm repo add nginx-proxy https://nginx-proxy:443 --ca-file /home/policy/ssl/ca.crt helm repo update |
Once the kubernetes-participant is set up, the tosca template can be commissioned. After that, the control loop can be instantiated using the steps described in the sub-section Commission/Instantiate control loop via GUI. Once the control loop is in RUNNING state, check that all three micro-services have been created in the nonrtric namespace.
...