(continued)
HOW-TO: delete xApps and re-deploy xApps
(1) How to delete xApps
First, check xApp Deployments in ns ricxapp:
(21:09 dabs@ricpltbronze dep) > sudo kubectl get deployment -n ricxapp
NAME READY UP-TO-DATE AVAILABLE AGE
ricxapp-hwxapp 1/1 1 1 21d
ricxapp-qp 1/1 1 1 22h
ricxapp-qpdriver 1/1 1 1 22h
ricxapp-trafficxapp 1/1 1 1 22h
Delete Deployments (using hwxapp as an example):
(21:09 dabs@ricpltbronze dep) > sudo kubectl delete deployment ricxapp-hwxapp -n ricxapp
deployment.apps "ricxapp-hwxapp" deleted
Find the appmgr Pod and its container(k8s_container-ricplt-appmgr_deployment-ricplt-appmgr-6fd6664755-4xqfr_ricplt_28402fc2-e16a-4aed-ba24-3c309387df88_0 or container_id=33ababfa61b6 in this case):
(21:11 dabs@ricpltbronze dep) > sudo kubectl get pods -A | grep appmgr
ricplt deployment-ricplt-appmgr-6fd6664755-4xqfr 1/1 Running 0 23h
(21:15 dabs@ricpltbronze dep) > docker container list | grep appmgr
33ababfa61b6 87851b9d06ec "/opt/xAppManager/ap…" 23 hours ago Up 23 hours k8s_container-ricplt-appmgr_deployment-ricplt-appmgr-6fd6664755-4xqfr_ricplt_28402fc2-e16a-4aed-ba24-3c309387df88_0
e68f430055b5 k8s.gcr.io/pause:3.1 "/pause" 23 hours ago Up 23 hours k8s_POD_deployment-ricplt-appmgr-6fd6664755-4xqfr_ricplt_28402fc2-e16a-4aed-ba24-3c309387df88_0
Execute shell within an interactive TTY of this container:
(21:17 dabs@ricpltbronze dep) > sudo docker exec -it 33ababfa61b6 sh
# pwd
/opt/xAppManager
# which helm
/usr/local/bin/helm
# helm list
NAME REVISION UPDATED STATUS CHART APP VERSION NAMESPACE
hwxapp 1 Sat Jul 18 00:04:20 2020 DEPLOYED hwxapp-1.0.0 1.0 ricxapp
qp 1 Fri Aug 7 14:10:26 2020 DEPLOYED qp-0.0.2 1.0 ricxapp
qpdriver 1 Fri Aug 7 14:09:53 2020 DEPLOYED qpdriver-1.0.9 1.0 ricxapp
trafficxapp 1 Fri Aug 7 14:10:37 2020 DEPLOYED trafficxapp-1.0.0 1.0 ricxapp
From 'helm list' output, we can see that there is a remaining hwxapp release, althought hwxapp Deployment has been deleted.
Delete hwxapp release using 'helm delete':
# helm delete --purge hwxapp
release "hwxapp" deleted
# helm list
NAME REVISION UPDATED STATUS CHART APP VERSION NAMESPACE
qp 1 Fri Aug 7 14:10:26 2020 DEPLOYED qp-0.0.2 1.0 ricxapp
qpdriver 1 Fri Aug 7 14:09:53 2020 DEPLOYED qpdriver-1.0.9 1.0 ricxapp
trafficxapp 1 Fri Aug 7 14:10:37 2020 DEPLOYED trafficxapp-1.0.0 1.0 ricxapp
#
(2) Re-deploy hwxapp
First, setup port-forwarding and make sure local helm server is up:
(22:49 dabs@ricpltbronze ~) > sudo kubectl port-forward r4-infrastructure-kong-6c7f6db759-skqzc 32088:32080 -n ricplt
[sudo] password for dabs:
Forwarding from 127.0.0.1:32088 -> 32080
Forwarding from [::1]:32088 -> 32080
(22:25 dabs@ricpltbronze ~) > sudo helm serve
[sudo] password for dabs:
Regenerating index. This may take a moment.
Now serving you on 127.0.0.1:8879
Execute shell within an interactive TTY of the appmgr container, to remove the 'stable' helm repository:
(21:30 dabs@ricpltbronze ~) > sudo docker exec -it 33ababfa61b6 sh
# helm repo list
NAME URL
stable https://kubernetes-charts.storage.googleapis.com
local http://127.0.0.1:8879/charts
helm-repo http://service-ricplt-xapp-onboarder-http:8080
# helm repo remove stable
"stable" has been removed from your repositories
# helm repo list
NAME URL
local http://127.0.0.1:8879/charts
helm-repo http://service-ricplt-xapp-onboarder-http:8080
Note: You may encouter the 'timeout' error when trying to deploy xApp if you haven't deleted the 'stable' repository.
Next, follow xApp deployment steps:
*get xapp descriptor (this step will be skipped since xapp descriptor already exists)
*on-boarding xapp
*deploy xapp
(21:27 dabs@ricpltbronze dep) > pwd
/home/dabs/oran/dep
(21:27 dabs@ricpltbronze dep) > sudo curl --location --request POST "http://localhost:32088/onboard/api/v1/onboard/download" --header 'Content-Type: application/json' --data-binary "@./onboard.hw.url"
{
"status": "Created"
}
(21:33 dabs@ricpltbronze dep) > sudo curl --location --request POST "http://localhost:32088/appmgr/ric/v1/xapps" --header 'Content-Type: application/json' --data-raw '{"xappName": "hwxapp"}'
{"instances":null,"name":"hwxapp","status":"deployed","version":"1.0"}
Make sure hwxapp Pod is running:
(21:33 dabs@ricpltbronze dep) > sudo kubectl get pods -n ricxapp
NAME READY STATUS RESTARTS AGE
ricxapp-hwxapp-684d8d675b-lhnfg 1/1 Running 0 5m32s
ricxapp-qp-5f6fc7b746-ff8tv 1/1 Running 0 23h
ricxapp-qpdriver-6b89bb66c-lbk4c 1/1 Running 0 23h
ricxapp-trafficxapp-96bc7bd6b-t995r 1/1 Running 0 23h
Check that 'helm list' has the hwxapp release:
# helm list
NAME REVISION UPDATED STATUS CHART APP VERSION NAMESPACE
hwxapp 1 Sat Aug 8 13:33:16 2020 DEPLOYED hwxapp-1.0.0 1.0 ricxapp
qp 1 Fri Aug 7 14:10:26 2020 DEPLOYED qp-0.0.2 1.0 ricxapp
qpdriver 1 Fri Aug 7 14:09:53 2020 DEPLOYED qpdriver-1.0.9 1.0 ricxapp
trafficxapp 1 Fri Aug 7 14:10:37 2020 DEPLOYED trafficxapp-1.0.0 1.0 ricxapp
Good Luck!