Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
docker run \
    --rm  \
    -it \
    -p 8112:8083  \
    --name helmmanagerservice \
    --network nonrtric-docker-net \
    -v $(pwd)/mnt/database:/var/helm-manager/database-service \
    -v ~/.kube:/root/.kube \
    -v ~/.helm:/root/.helm \
    -v ~/.config/helm:/root/.config/helm \
    -v ~/.cache/helm:/root/.cache/helm \
    -v $(pwd)/config/application.yaml:/etc/app/helm-manager/application.yaml \
    nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-helm-manager:1.1.0

...

As an alternative, run the script 'test.sh' to execute a full sequence of commands.

Code Block
languagebash
// Get charts
$ Start test
================
Get apps - empty
================
curl -sw %{http_code} http://localhosthelmadmin:itisasecret@localhost:8112/helm/charts
 Curl OK
  Response: 200
  Body: {"charts":[]}200

// Onboard the chart
$ 

================
Add repo
================
curl -sw %{http_code} http://localhosthelmadmin:itisasecret@localhost:8112/helm/repo -X POST -H Content-Type:application/json -d @cm-repo.json
 Curl OK
  Response: 201
  Body: 

============
Onboard app
===========
curl -sw %{http_code} http://helmadmin:itisasecret@localhost:8112/helm/chartsonboard/chart -X POST -F chart=@simple-app-0.1.0.tgz -F values=@simple-app-values.yaml -F "info=<simple-app.json"
 Curl OK
  Response: 200
  Body: 

// List the chart(s)
$ =====================
Get apps - simple-app
=====================
curl -sw %{http_code} http://localhosthelmadmin:itisasecret@localhost:8112/helm/charts
 Curl OK
  Response: 200
  Body: {"charts":[{"releaseName":"simpleapp","chartId":{"chartNamename":"simple-app","version":"0.1.0"},"namespace":"ckhm","repository":{"cm"}]}200

// Install the chart (app) - note: the namespace ckhm is created in kubernetes
$ repoName":"cm","protocol":null,"address":null,"port":null,"userName":null,"password":null},"overrideParams":null}]}

===========
Install app
===========
curl -sw %{http_code} http://localhosthelmadmin:itisasecret@localhost:8112/helm/install -X POST -H Content-Type:application/json -d @simple-app-installation.json
 Curl OK
  Response: 201
  Body: 

=====================
Get apps - simple-app
=====================
$ curl -sw %{http_code} http://localhosthelmadmin:itisasecret@localhost:8112/helm/charts
 Curl OK
  Response: 200
  Body: {"charts":[{"releaseName":"simpleapp","chartNamechartId":{"name":"simple-app","version":"0.1.0"},"namespace":"ckhm","repository":{"repoName":"cm"}]}

//List the installed chart using helm ls
// helm ls -A","protocol":null,"address":null,"port":null,"userName":null,"password":null},"overrideParams":null}]}

=================================================================
helm ls to list installed app - simpleapp chart should be visible
=================================================================
NAME     	NAMESPACE	REVISION	UPDATED                                	STATUS  	CHART           	APP VERSION
simpleapp	ckhm     	1       	2021-12-0214 2010:5314:2130.52883025917334268 +0000 UTC	deployed	simple-app-0.1.0	1.16.0     

// List the service and pods in kubernetes - may take a few seconds until the object are created in kubernetes
$ kubectl get svc -n ckhm
NAME            ==========================================
sleep 30 - give the app some time to start
==========================================
============================
List svc and  pod of the app
============================
NAME                   TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)   AGE
simpleapp-simple-app   ClusterIP   10.107.86.92   <none>        80/TCP    30s
$ kubectl get pods -n ckhm
NAME                                    READY   STATUS    RESTARTS   AGE
simpleapp-simple-app-675f44fc99-wpd6g   1/1     Running   0          31s
S)   AGE
simpleapp-simple-app   ClusterIP   10.96.30.250   <none>        80/TCP    30s
NAME                                    READY   STATUS    RESTARTS   AGE
simpleapp-simple-app-675f44fc99-mpvnd   1/1     Running   0          31s

========================
Uninstall app simple-app
========================
curl -sw %{http_code} http://helmadmin:itisasecret@localhost:8112/helm/uninstall/simple-app/0.1.0 -X DELETE
 Curl OK
  Response: 204
  Body: 

===========================================
sleep 30 - give the app some time to remove
===========================================
============================================================
List svc and  pod of the app - should be gone or terminating
============================================================
No resources found in ckhm namespace.
No resources found in ckhm namespace.

=====================
Get apps - simple-app
=====================
curl -sw %{http_code} http://helmadmin:itisasecret@localhost:8112/helm/charts
 Curl OK
  Response: 200
  Body: {"charts":[{"releaseName":"simpleapp","chartId":{"name":"simple-app","version":"0.1.0"},"namespace":"ckhm","repository":{"repoName":"cm","protocol":null,"address":null,"port":null,"userName":null,"password":null},"overrideParams":null}]}

============
Delete chart
===========
curl -sw %{http_code} http://helmadmin:itisasecret@localhost:8112/helm/chart/simple-app/0.1.0 -X DELETE
 Curl OK
  Response: 204
  Body: 

================
Get apps - empty
================
curl -sw %{http_code} http://helmadmin:itisasecret@localhost:8112/helm/charts
 Curl OK
  Response: 200
  Body: {"charts":[]}

Test result  All tests ok 
End of test

To run in the helm manager in kubernetes see this page:  Run Helm Manager in kubernetes

...

Code Block
languagebash
titlejob3.json
{
  "info_type_id": "STD_Fault_Messages",
  "job_result_uri": "<url-for-jodjob-data-delivery>",
  "job_owner": "job3owner",
  "status_notification_uri": "<url-for-jodjob-status-delivery>",
  "job_definition": {}
}

...