From 31b09880413a8708a5ecfbd4ad83a91a01661892 Mon Sep 17 00:00:00 2001 From: BjornMagnussonXA Date: Wed, 2 Jun 2021 01:56:26 +0200 Subject: [PATCH] Helm manager app Docker scripts Kubernetes script Image build scripts Config files Test files Issue-ID: NONRTRIC-529 Signed-off-by: BjornMagnussonXA Change-Id: I25deb86bc815c5d63c5ff7c0dcb7a157ddee734e --- helm-manager/.gitignore | 4 + helm-manager/Dockerfile | 47 +++++ .../config/KubernetesParticipantConfig.json | 49 +++++ helm-manager/config/application.yaml | 42 +++++ helm-manager/docker-cm.sh | 30 +++ helm-manager/docker-hm.sh | 34 ++++ helm-manager/helm-manager-sa.yaml | 36 ++++ helm-manager/helm-manager.yaml | 101 ++++++++++ helm-manager/kube-cm.yaml | 108 +++++++++++ helm-manager/mnt/database/.gitignore | 1 + helm-manager/pom.xml | 146 +++++++++++++++ helm-manager/simple-app-installation.json | 4 + helm-manager/simple-app-values.yaml | 23 +++ helm-manager/simple-app.json | 7 + helm-manager/test.sh | 208 +++++++++++++++++++++ 15 files changed, 840 insertions(+) create mode 100644 helm-manager/.gitignore create mode 100644 helm-manager/Dockerfile create mode 100644 helm-manager/config/KubernetesParticipantConfig.json create mode 100644 helm-manager/config/application.yaml create mode 100755 helm-manager/docker-cm.sh create mode 100755 helm-manager/docker-hm.sh create mode 100644 helm-manager/helm-manager-sa.yaml create mode 100644 helm-manager/helm-manager.yaml create mode 100644 helm-manager/kube-cm.yaml create mode 100644 helm-manager/mnt/database/.gitignore create mode 100644 helm-manager/pom.xml create mode 100644 helm-manager/simple-app-installation.json create mode 100644 helm-manager/simple-app-values.yaml create mode 100644 helm-manager/simple-app.json create mode 100755 helm-manager/test.sh diff --git a/helm-manager/.gitignore b/helm-manager/.gitignore new file mode 100644 index 00000000..5e41250a --- /dev/null +++ b/helm-manager/.gitignore @@ -0,0 +1,4 @@ +charts +simple-app +target +*.tgz diff --git a/helm-manager/Dockerfile b/helm-manager/Dockerfile new file mode 100644 index 00000000..b9283c09 --- /dev/null +++ b/helm-manager/Dockerfile @@ -0,0 +1,47 @@ +# ============LICENSE_START=============================================== +# Copyright (C) 2020 Nordix Foundation. All rights reserved. +# ======================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END================================================= +# + +FROM openjdk:11-jre-slim + +ARG JAR + +#Install curl +RUN apt-get update +RUN apt-get install -y curl + +#Install helm +RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 +RUN chmod 700 get_helm.sh +RUN ./get_helm.sh + +#Install kubectl and configure +RUN curl -LO https://dl.k8s.io/release/v1.20.2/bin/linux/amd64/kubectl + +RUN chmod +x ./kubectl + +RUN mv ./kubectl /usr/local/bin/kubectl + +# Copy app config and app jar +WORKDIR /opt/app/helm-manager/src/main/resources/config + +COPY config/KubernetesParticipantConfig.json . +COPY config/application.yaml . + +WORKDIR /opt/app/helm-manager +COPY target/app.jar app.jar + +CMD [ "java", "-jar", "app.jar" ] diff --git a/helm-manager/config/KubernetesParticipantConfig.json b/helm-manager/config/KubernetesParticipantConfig.json new file mode 100644 index 00000000..7eeb456d --- /dev/null +++ b/helm-manager/config/KubernetesParticipantConfig.json @@ -0,0 +1,49 @@ +{ + "name": "ControlLoopParticipantK8s", + "localChartDirectory": "/var/helm-manager/local-charts", + "infoFileName": "CHART_INFO.json", + + "intermediaryParameters":{ + "name":"Participant parameters", + "reportingTimeInterval":120000, + "description":"Participant Description", + "participantId":{ + "name":"K8sParticipant0", + "version":"1.0.0" + }, + "participantType":{ + "name":"org.onap.k8s.controlloop.K8SControlLoopParticipant", + "version":"2.3.4" + }, + "clampControlLoopTopics":{ + "topicSources":[ + + ], + "topicSinks":[ + { + "topic":"POLICY-CLRUNTIME-PARTICIPANT", + "servers":[ + "localhost" + ], + "topicCommInfrastructure":"dmaap" + }, + { + "topic":"POLICY-NOTIFICATION", + "servers":[ + "localhost" + ], + "topicCommInfrastructure":"dmaap" + } + ] + } + }, + "databaseProviderParameters":{ + "name":"PolicyProviderParameterGroup", + "implementation":"org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl", + "databaseDriver":"org.mariadb.jdbc.Driver", + "databaseUrl":"jdbc:mariadb://localhost:3306/controlloop", + "databaseUser":"admin", + "databasePassword":"passme", + "persistenceUnit":"ToscaConceptTest" + } +} diff --git a/helm-manager/config/application.yaml b/helm-manager/config/application.yaml new file mode 100644 index 00000000..44de5098 --- /dev/null +++ b/helm-manager/config/application.yaml @@ -0,0 +1,42 @@ +# ============LICENSE_START=============================================== +# Copyright (C) 2020 Nordix Foundation. All rights reserved. +# ======================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END================================================= +# + +spring: + profiles: + active: prod + +participant: + file: src/main/resources/config/KubernetesParticipantConfig.json +management: + endpoints: + web: + exposure: + include: "loggers,logfile,health,info,metrics,threaddump,heapdump" +server: + # Configuration of the HTTP/REST server. The parameters are defined and handled by the springboot framework. + # See springboot documentation. + http-port : 8083 + +logging: + # Configuration of logging + level: + ROOT: INFO + org.springframework: ERROR + org.springframework.data: ERROR + org.springframework.web.reactive.function.client.ExchangeFunctions: ERROR + file: + name: /var/log/helm-manager/application.log diff --git a/helm-manager/docker-cm.sh b/helm-manager/docker-cm.sh new file mode 100755 index 00000000..bf55befe --- /dev/null +++ b/helm-manager/docker-cm.sh @@ -0,0 +1,30 @@ +#! /bin/bash + +# ============LICENSE_START=============================================== +# Copyright (C) 2021 Nordix Foundation. All rights reserved. +# ======================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END================================================= + +# Starts a chartmuseum container + + +docker run --rm -it \ + -p 8222:8080 \ + --name chartmuseum \ + --network nonrtric-docker-net \ + -e DEBUG=1 \ + -e STORAGE=local \ + -e STORAGE_LOCAL_ROOTDIR=/charts \ + -v $(pwd)/charts:/charts \ + ghcr.io/helm/chartmuseum:v0.13.1 \ No newline at end of file diff --git a/helm-manager/docker-hm.sh b/helm-manager/docker-hm.sh new file mode 100755 index 00000000..c98b22a9 --- /dev/null +++ b/helm-manager/docker-hm.sh @@ -0,0 +1,34 @@ +#! /bin/bash + +# ============LICENSE_START=============================================== +# Copyright (C) 2021 Nordix Foundation. All rights reserved. +# ======================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END================================================= + +# Starts a helm manager container + +docker run \ + --rm \ + -it \ + -p 8112:8083 \ + --name helmmanagerservice \ + --network nonrtric-docker-net \ + -v $(pwd)/mnt/database:/var/helm-manager/database \ + -v ~/.kube:/root/.kube \ + -v ~/.helm:/root/.helm \ + -v ~/.config/helm:/root/.config/helm \ + -v ~/.cache/helm:/root/.cache/helm \ + -v $(pwd)/config/KubernetesParticipantConfig.json:/opt/app/helm-manager/src/main/resources/config/KubernetesParticipantConfig.json \ + -v $(pwd)/config/application.yaml:/opt/app/helm-manager/src/main/resources/config/application.yaml \ + nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-helm-manager:1.0.0-SNAPSHOT \ No newline at end of file diff --git a/helm-manager/helm-manager-sa.yaml b/helm-manager/helm-manager-sa.yaml new file mode 100644 index 00000000..3ac50e58 --- /dev/null +++ b/helm-manager/helm-manager-sa.yaml @@ -0,0 +1,36 @@ +# ============LICENSE_START=============================================== +# Copyright (C) 2020 Nordix Foundation. All rights reserved. +# ======================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END================================================= +# + +apiVersion: v1 +kind: ServiceAccount +metadata: + name: helm-manager-sa + namespace: nonrtric +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: helm-manager-sa-clusterrolebinding + namespace: nonrtric +subjects: +- kind: ServiceAccount + name: helm-manager-sa + namespace: nonrtric +roleRef: + kind: ClusterRole + name: cluster-admin + apiGroup: rbac.authorization.k8s.io \ No newline at end of file diff --git a/helm-manager/helm-manager.yaml b/helm-manager/helm-manager.yaml new file mode 100644 index 00000000..093752e0 --- /dev/null +++ b/helm-manager/helm-manager.yaml @@ -0,0 +1,101 @@ +# ============LICENSE_START=============================================== +# Copyright (C) 2020 Nordix Foundation. All rights reserved. +# ======================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END================================================= +# + +apiVersion: v1 +kind: Service +metadata: + name: helmmanagerservice + namespace: nonrtric + labels: + run: helmmanagerservice +spec: + type: NodePort + ports: + - port: 8080 + targetPort: 8080 + protocol: TCP + name: http + - port: 8443 + targetPort: 8443 + protocol: TCP + name: https + selector: + run: helmmanagerservice + +--- + +apiVersion: v1 +kind: Pod +metadata: + name: helmmanagerservice + namespace: nonrtric + labels: + run: helmmanagerservice +spec: + serviceAccountName: helm-manager-sa + containers: + - name: helmmanagerservice + image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-helm-manager:1.0.0-SNAPSHOT + imagePullPolicy: Always + ports: + - name: http + containerPort: 8080 + - name: https + containerPort: 8443 + volumeMounts: + - mountPath: /var/helm-manager-service + name: helm-manager-service-pv + volumes: + - name: helm-manager-service-pv + persistentVolumeClaim: + claimName: helm-manager-service-pvc + +--- + +apiVersion: v1 +kind: PersistentVolume +metadata: + name: helm-manager-service-pv + labels: + run: helm-manager-service +spec: + storageClassName: helm-manager-service-standard + capacity: + storage: 10Mi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Delete + hostPath: + path: "/tmp/helm-manager-service" + +--- + +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: helm-manager-service-pvc + namespace: nonrtric + labels: + run: helm-manager-service +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Mi + storageClassName: helm-manager-service-standard + volumeMode: Filesystem diff --git a/helm-manager/kube-cm.yaml b/helm-manager/kube-cm.yaml new file mode 100644 index 00000000..c75ebd5a --- /dev/null +++ b/helm-manager/kube-cm.yaml @@ -0,0 +1,108 @@ +# ============LICENSE_START=============================================== +# Copyright (C) 2020 Nordix Foundation. All rights reserved. +# ======================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END================================================= +# + +apiVersion: v1 +kind: Service +metadata: + name: chartrepo + namespace: nonrtric + labels: + run: chartrepo +spec: + type: NodePort + ports: + - port: 8080 + targetPort: 8080 + protocol: TCP + name: http + selector: + run: chartrepo + +--- + +apiVersion: v1 +kind: Pod +metadata: + name: chartrepo + namespace: nonrtric + labels: + run: chartrepo +spec: + securityContext: + runAsUser: 0 + containers: + - name: chartrepo + image: ghcr.io/helm/chartmuseum:v0.13.1 + imagePullPolicy: Always + ports: + - name: http + containerPort: 8080 + env: + - name: DEBUG + value: "1" + - name: STORAGE + value: "local" + - name: STORAGE_LOCAL_ROOTDIR + value: "/var/chartrepo/charts" + - name: DISABLE_API + value: "false" + volumeMounts: + - mountPath: /var/chartrepo/charts + name: chartrepo-pv + volumes: + - name: chartrepo-pv + persistentVolumeClaim: + claimName: chartrepo-pvc + + +--- + +apiVersion: v1 +kind: PersistentVolume +metadata: + name: chartrepo-pv + annotations: + pv.beta.kubernetes.io/gid: "999" + labels: + run: chartrepo +spec: + storageClassName: chartrepo-standard + capacity: + storage: 10Mi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Delete + hostPath: + path: "/tmp/chartrepo" + +--- + +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: chartrepo-pvc + namespace: nonrtric + labels: + run: chartrepo +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Mi + storageClassName: chartrepo-standard + volumeMode: Filesystem diff --git a/helm-manager/mnt/database/.gitignore b/helm-manager/mnt/database/.gitignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/helm-manager/mnt/database/.gitignore @@ -0,0 +1 @@ +* diff --git a/helm-manager/pom.xml b/helm-manager/pom.xml new file mode 100644 index 00000000..0c52a123 --- /dev/null +++ b/helm-manager/pom.xml @@ -0,0 +1,146 @@ + + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.3.8.RELEASE + + + org.o-ran-sc.nonrtric + helm-manager + + 1.0.0-SNAPSHOT + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + + + + + 6.1.2-SNAPSHOT + 0.36.0 + 3.1.2 + + + + org.onap.policy.clamp.participant + policy-clamp-participant-impl-kubernetes + ${policy-clamp-participant-impl-kubernetes.version} + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + ${maven-dependency-plugin.version} + + + copy + package + + copy + + + + + org.onap.policy.clamp.participant + policy-clamp-participant-impl-kubernetes + ${policy-clamp-participant-impl-kubernetes.version} + jar + true + ${basedir}/target + app.jar + + + + + + + + io.fabric8 + docker-maven-plugin + ${docker-maven-plugin.version} + false + + + generate-helm-manager-image + package + + build + + + ${env.CONTAINER_PULL_REGISTRY} + + + o-ran-sc/nonrtric-helm-manager:${project.version} + + try + ${basedir} + Dockerfile + + ${project.version} + + + + + + + + push-helm-manager-image + + build + push + + + ${env.CONTAINER_PULL_REGISTRY} + ${env.CONTAINER_PUSH_REGISTRY} + + + o-ran-sc/nonrtric-helm-manager:${project.version} + + ${basedir} + Dockerfile + + ${project.version} + latest + + + + + + + + + + + + JIRA + https://jira.o-ran-sc.org/ + + \ No newline at end of file diff --git a/helm-manager/simple-app-installation.json b/helm-manager/simple-app-installation.json new file mode 100644 index 00000000..b9760f22 --- /dev/null +++ b/helm-manager/simple-app-installation.json @@ -0,0 +1,4 @@ +{ + "name": "simple-app", + "version": "0.1.0" +} \ No newline at end of file diff --git a/helm-manager/simple-app-values.yaml b/helm-manager/simple-app-values.yaml new file mode 100644 index 00000000..873396df --- /dev/null +++ b/helm-manager/simple-app-values.yaml @@ -0,0 +1,23 @@ +# ============LICENSE_START=============================================== +# Copyright (C) 2020 Nordix Foundation. All rights reserved. +# ======================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END================================================= +# + +# Override values for simple-app. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + + +## No override values defined ## \ No newline at end of file diff --git a/helm-manager/simple-app.json b/helm-manager/simple-app.json new file mode 100644 index 00000000..27f73c84 --- /dev/null +++ b/helm-manager/simple-app.json @@ -0,0 +1,7 @@ +{ + "releaseName": "simpleapp", + "chartName": "simple-app", + "version": "0.1.0", + "namespace": "ckhm", + "repository": "cm" +} \ No newline at end of file diff --git a/helm-manager/test.sh b/helm-manager/test.sh new file mode 100755 index 00000000..1b652bf2 --- /dev/null +++ b/helm-manager/test.sh @@ -0,0 +1,208 @@ +#!/bin/bash + +# ============LICENSE_START=============================================== +# Copyright (C) 2021 Nordix Foundation. All rights reserved. +# ======================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END================================================= +# + + +BOLD="\033[1m" +EBOLD="\033[0m" +BOLD="\033[1m" +EBOLD="\033[0m" +RED="\033[31m\033[1m" +ERED="\033[0m" +GREEN="\033[32m\033[1m" +EGREEN="\033[0m" + +echo "" +echo "Start test" + +APP_TGZ="simple-app-0.1.0.tgz" +VALUES_YAML="simple-app-values.yaml" +INFO_JSON="simple-app.json" +INSTALL_JSON="simple-app-installation.json" + +PORT="" +HOST="" +URL="" +HM_PATH="" +NAMESPACE="ckhm" #kube namespace for simple-app +PROXY_TAG="" + +OK="All tests ok" + +print_usage() { + echo "usage: ./test.sh docker|(kube )" +} +if [ $# -eq 1 ]; then + if [ $1 == "docker" ]; then + PORT=8112 + HOST="localhost" + URL="http://$HOST:$PORT" + HM_PATH=$URL + else + print_usage + exit 1 + fi +elif [ $# -eq 2 ]; then + if [ $1 == "kube" ]; then + PORT=$(kubectl get svc helmmanagerservice -n nonrtric -o jsonpath='{...ports[?(@.name=="'http'")].nodePort}') + HOST=$2 + URL="http://$HOST:$PORT" + HM_PATH=$URL + else + print_usage + exit 1 + fi +else + print_usage + exit 1 +fi + + + +run-curl() { + curl_cmd="curl -sw %{http_code} $PROXY_TAG $HM_PATH$@" + echo $curl_cmd + res=$($curl_cmd) + retcode=$? + status=${res:${#res}-3} + if [ -z "$res" ]; then + body="" + elif [ ${#res} -gt 2 ]; then + body=${res:0:${#res}-3} + else + body="" + fi + if [ $retcode -ne 0 ]; then + echo -e $RED" FAIL - Curl failed"$ERED + echo " Curl return code: $retcode" + OK="One or more tests failed" + else + if [[ $status -gt 199 ]] && [[ $status -lt 300 ]]; then + echo -e $GREEN" Curl OK"$EGREEN + echo " Response: "$status + echo " Body: "$body + else + echo -e $RED" FAIL, non 2XX response"$ERED + echo " Response: "$status + echo " Body: "$body + OK="One or more tests failed" + fi + fi +} + +echo "================" +echo "Get apps - empty" +echo "================" +cmd="/helm/charts" +run-curl $cmd +echo + + +echo "============" +echo "Onboard app" +echo "===========" +cmd="/helm/charts -X POST -F chart=@$APP_TGZ -F values=@$VALUES_YAML -F info=<$INFO_JSON" +run-curl $cmd +echo + + +echo "=====================" +echo "Get apps - simple-app" +echo "=====================" +cmd="/helm/charts" +run-curl $cmd +echo + + +echo "===========" +echo "Install app" +echo "===========" +cmd="/helm/install -X POST -H Content-Type:application/json -d @$INSTALL_JSON" +run-curl $cmd +echo + + + +echo "=====================" +echo "Get apps - simple-app" +echo "=====================" +cmd="/helm/charts" +run-curl $cmd +echo + +echo "=================================================================" +echo "helm ls to list installed app - simpleapp chart should be visible" +echo "=================================================================" +helm ls -A +echo + +echo "==========================================" +echo "sleep 30 - give the app some time to start" +echo "==========================================" +sleep 30 + +echo "============================" +echo "List svc and pod of the app" +echo "============================" +kubectl get svc -n $NAMESPACE +kubectl get po -n $NAMESPACE +echo + +echo "========================" +echo "Uninstall app simple-app" +echo "========================" +cmd="/helm/uninstall/simple-app/0.1.0 -X DELETE" +run-curl $cmd +echo + +echo "===========================================" +echo "sleep 30 - give the app some time to remove" +echo "===========================================" +sleep 30 + +echo "============================================================" +echo "List svc and pod of the app - should be gone or terminating" +echo "============================================================" +kubectl get svc -n $NAMESPACE +kubectl get po -n $NAMESPACE +echo + + +echo "=====================" +echo "Get apps - simple-app" +echo "=====================" +cmd="/helm/charts" +run-curl $cmd +echo + +echo "============" +echo "Delete chart" +echo "===========" +cmd="/helm/charts/simple-app/0.1.0 -X DELETE" +run-curl $cmd +echo + +echo "================" +echo "Get apps - empty" +echo "================" +cmd="/helm/charts" +run-curl $cmd +echo + +echo -e "Test result $BOLD $OK $EBOLD" +echo "End of test" -- 2.16.6