...
- As kubernetes service and pod on a local machine with kubernetes or in minikube
- As kubernetes service and pod on a kubernetes cluster
- As docker container on a local machine with kubernbetes (see Draft - Release E - Run in Docker)
Prerequisites
The following need to be installed, latest version, on the machine
...
Clone the nonrtric repo from gerrit and change dir to helm-manager. Make sure to use the correct branch when cloning, use "master" until the branch for D E Release is available.
All needed scripts for starting and running the helm manager, in docker or kubernetes are in this directory.
If the Helm Manager shall be installed in a kubernetes cluster the actions below shall be made on a node in cluster. FIXME: branch name
Code Block | ||||
---|---|---|---|---|
| ||||
$ git clone "https://gerrit.o-ran-sc.org/r/nonrtric" -b <branch>e-release $ cd helm-manager |
Create helm chart for test
...
Code Block | ||||
---|---|---|---|---|
| ||||
$ kubectl exec -it helmmanagerservice -n nonrtric -- sh # helm repo add cm http://chartrepo.nonrtric:8080 "cm" has been added to your repositories $ exit |
The helm manager is now running and configured with a chart repo.
...
Code Block | ||||
---|---|---|---|---|
| ||||
Start test ================ Get apps - empty ================ curl -sw %{http_code} http://localhost:32743helmadmin:itisasecret@kubernetes.docker.internal:30712/helm/charts Curl OK Response: 200 Body: {"charts":[]} ================ OnboardAdd apprepo ================ curl -sw %{http_code} http://localhost:32743helmadmin:itisasecret@kubernetes.docker.internal:30712/helm/chartsrepo -X POST -FH chart=@simple-app-0.1.0.tgz -F values=@simple-app-values.yaml -F info=<simple-app.Content-Type:application/json -d @cm-repo.json Curl OK Response: 200201 Body: ===================== Get apps - simple- Onboard app ===================== curl -sw %{http_code} http://localhost:32743helmadmin:itisasecret@kubernetes.docker.internal:30712/helm/onboard/charts chart Curl-X OK POST Response: 200 Body:-F chart=@simple-app-0.1.0.tgz -F values=@simple-app-values.yaml -F info=<simple-app.json Curl OK Response: 200 Body: ===================== Get apps - simple-app ===================== curl -sw %{http_code} http://helmadmin:itisasecret@kubernetes.docker.internal:30712/helm/charts Curl OK Response: 200 Body: {"charts":[{"releaseName":"simpleapp","chartId":{"chartNamename":"simple-app","version":"0.1.0"},"namespace":"ckhm","repository":{"repoName":"cm","protocol":null,"address":null,"port":null,"userName":null,"password":null},"overrideParams":null}]} =========== Install app =========== curl -sw %{http_code} http://localhost:32743/://helmadmin:itisasecret@kubernetes.docker.internal:30712/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://localhost:32743helmadmin:itisasecret@kubernetes.docker.internal:30712/helm/charts Curl OK Response: 200 Body: {"charts":[{"releaseName":"simpleapp","chartName"chartId":{"name":"simple-app","version":"0.1.0","namespace":"ckhm","repository":"cm"}]} .0"},"namespace":"ckhm","repository":{"repoName":"cm","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-0612-0114 2208:2410:1233.797624073785870875 +0000 UTC deployed simple-app-0.1.0 1.16.0 ========================================== 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.105106.1179.12947 <none> 80/TCP 30s NAME READY STATUS RESTARTS AGE simpleapp-simple-app-675f44fc99-mr7lp 1/1 Running 0 STATUS RESTARTS AGE simpleapp-simple-app-858c798f97-k6vsl 1/1 Running 0 30s ==== 30s ======================== Uninstall app simple-app ======================== curl -sw %{http_code} http://helmadmin:itisasecret@kubernetes.docker.internal:30712/helm/uninstall/simple-app/0.1.0 -X DELETE Curl OK Response: 204 Body: ==================== Uninstall app simple-app ======================== curl -sw %{http_code} http://localhost:32743/helm/uninstall/simple-app/0.1.0 -X DELETE Curl OK Response: 204 Body: sleep 10 - give the app some time to remove == 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. NAME READY STATUS RESTARTS AGE simpleapp-simple-app-858c798f97-k6vsl 0/1 Terminating 0 41s======== No resources found in ckhm namespace. No resources found in ckhm namespace. ===================== Get apps - simple-app ===================== curl -sw %{http_code} http://localhost:32743helmadmin:itisasecret@kubernetes.docker.internal:30712/helm/charts Curl OK Response: 200 Body: {"charts":[{"releaseName":"simpleapp","chartId":{"name":"simple-app","version":"0.1.0"},"namespace":"ckhm","repository":{"repoName":"simpleappcm","chartNameprotocol":null,"simple-appaddress":null,"versionport":"0.1.0"null,"userName":null,"namespacepassword":"ckhm"null},"repositoryoverrideParams":"cm"null}]} ============ Delete chart =========== curl -sw %{http_code} http://localhost:32743helmadmin:itisasecret@kubernetes.docker.internal:30712/helm/chartschart/simple-app/0.1.0 -X DELETE Curl OK Response: 204 Body: ================ Get apps - empty ================ curl -sw %{http_code} http://localhost:32743helmadmin:itisasecret@kubernetes.docker.internal:30712/helm/charts Curl OK Response: 200 Body: {"charts":[]} Test result All tests ok End of test |
...