Adaptations to latest helm participant jar 45/7345/2
authorBjornMagnussonXA <bjorn.magnusson@est.tech>
Tue, 14 Dec 2021 08:19:33 +0000 (09:19 +0100)
committerBjornMagnussonXA <bjorn.magnusson@est.tech>
Tue, 14 Dec 2021 08:32:56 +0000 (09:32 +0100)
Issue-ID: NONRTRIC-618

Signed-off-by: BjornMagnussonXA <bjorn.magnusson@est.tech>
Change-Id: Ie72db61fc5bc3064a29dc60417cba4b27980a643

helm-manager/Dockerfile
helm-manager/charts/templates/_service.tpl
helm-manager/charts/templates/deployment.yaml
helm-manager/charts/values.yaml
helm-manager/cm-repo.json [new file with mode: 0644]
helm-manager/config/KubernetesParticipantConfig.json [deleted file]
helm-manager/config/application.yaml
helm-manager/helm-manager.yaml
helm-manager/pom.xml
helm-manager/simple-app.json
helm-manager/test.sh

index 90164fd..5e96b60 100644 (file)
@@ -40,13 +40,10 @@ 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 .
+WORKDIR /etc/app/helm-manager
 COPY config/application.yaml .
 
 WORKDIR /opt/app/helm-manager
 COPY target/app.jar app.jar
 
-CMD [ "java", "-jar", "app.jar" ]
+CMD [ "java", "-jar", "app.jar", "--spring.config.location=optional:file:/etc/app/helm-manager/"]
index 4c3cd7f..0424994 100644 (file)
   protocol: TCP
 {{- end }}
 {{- end }}
-{{- if .tls }}
-{{if eq .tls.enabled true -}}
-- name: {{ .name }}-tls
-  port: {{ .tls.servicePort }}
-  targetPort: {{ .tls.containerPort }}
-  protocol: TCP
-{{- end }}
-{{- end }}
 {{- end -}}
\ No newline at end of file
index 8296ca5..d863bf6 100644 (file)
@@ -39,8 +39,6 @@ spec:
           ports:
           - containerPort: {{ .Values.service.http.containerPort }}
             protocol: TCP
-          - containerPort: {{ .Values.service.tls.containerPort }}
-            protocol: TCP
           volumeMounts:
             - name: {{ template "helmmanager.name" . }}-pv
               mountPath: /var/helm-manager-service
index c645915..deb37d0 100644 (file)
 # -----------------------------------------------------------------------------
 # Specify Helm Manager's Docker image and repository details here
 image:
-  registry: nexus3.o-ran-sc.org:10004
+  registry: nexus3.o-ran-sc.org:10002
   name: o-ran-sc/nonrtric-helm-manager
-  tag: "1.0.0"
-  pullPolicy: IfNotPresent
+  tag: "1.1.0"
+  pullPolicy: Always
 service:
   type: NodePort
   http:
-    # Enable plaintext HTTP call to the API
-    # Disabling this and using a TLS listen only is recommended for most configuration
     enabled: true
-    servicePort: 8080
-    containerPort: 8080
-  tls:
-    # Enable HTTPS listen for the API
-    enabled: true
-    servicePort: 8443
-    containerPort: 8443
+    servicePort: 8112
+    containerPort: 8083
 
 # -----------------------------------------------------------------------------
 # Ingress Controller parameters
@@ -73,7 +66,7 @@ replicaCount: 1
 readinessProbe:
   httpGet:
     path: "/helm/charts"
-    port: 8080
+    port: 8083
     scheme: HTTP
   initialDelaySeconds: 60
   timeoutSeconds: 5
@@ -85,7 +78,7 @@ readinessProbe:
 livenessProbe:
   httpGet:
     path: "/helm/charts"
-    port: 8080
+    port: 8083
     scheme: HTTP
   initialDelaySeconds: 60
   timeoutSeconds: 5
diff --git a/helm-manager/cm-repo.json b/helm-manager/cm-repo.json
new file mode 100644 (file)
index 0000000..3335e02
--- /dev/null
@@ -0,0 +1,6 @@
+{
+  "address" : "chartrepo.nonrtric",
+  "repoName": "cm",
+  "protocol": "http",
+  "port": "8080"
+}
\ No newline at end of file
diff --git a/helm-manager/config/KubernetesParticipantConfig.json b/helm-manager/config/KubernetesParticipantConfig.json
deleted file mode 100644 (file)
index 7eeb456..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-{
-    "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"
-    }
-}
index 44de509..5da6c53 100644 (file)
 spring:
   profiles:
     active: prod
+  security:
+    user:
+      name: helmadmin
+      password: itisasecret
+security:
+  enable-csrf: false
+
 
 participant:
-  file: src/main/resources/config/KubernetesParticipantConfig.json
+  localChartDirectory: /var/helm-manager-service
+  # This below is not used but need to be here to make the app work
+  infoFileName: CHART_INFO.json
+  intermediaryParameters:
+    reportingTimeIntervalMs: 120000
+    description: Dummy Description
+    participantId:
+      name: noname
+      version: 0.0.1
+    participantType:
+      name: noname
+      version: 0.0.1
+    clampControlLoopTopics:
+      topicSources:
+      topicSinks:
+        -
+          topic: NOTOPIC
+          servers:
+            - localhost
+          topicCommInfrastructure: dmaap
+
 management:
   endpoints:
     web:
@@ -29,7 +56,9 @@ management:
 server:
   # Configuration of the HTTP/REST server. The parameters are defined and handled by the springboot framework.
   # See springboot documentation.
-  http-port : 8083
+  port: 8083
+  servlet:
+    context-path:
 
 logging:
   # Configuration of logging
@@ -38,5 +67,7 @@ logging:
     org.springframework: ERROR
     org.springframework.data: ERROR
     org.springframework.web.reactive.function.client.ExchangeFunctions: ERROR
+    com.att.nsa.cambria.client.impl: OFF
+    com.att.nsa.apiClient.http: OFF
   file:
-    name: /var/log/helm-manager/application.log
+    name: /var/log/onap/policy/clamp/application.log
index 5a3465c..2dafed8 100644 (file)
@@ -26,7 +26,7 @@ spec:
   type: NodePort
   ports:
   - port: 8080
-    targetPort: 8080
+    targetPort: 8083
     protocol: TCP
     name: http
   - port: 8443
@@ -49,11 +49,11 @@ spec:
   serviceAccountName: helm-manager-sa
   containers:
   - name: helmmanagerservice
-    image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-helm-manager:1.1.0-SNAPSHOT
+    image: nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-helm-manager:1.1.0
     imagePullPolicy: Always
     ports:
     - name: http
-      containerPort: 8080
+      containerPort: 8083
     - name: https
       containerPort: 8443
     volumeMounts:
index 7ca6291..5864f00 100644 (file)
             <name>onap-releases</name>
             <url>https://nexus.onap.org/content/repositories/releases/</url>
         </repository>
-        <repository>
-            <id>onap-snapshots</id>
-            <name>onap-snapshots</name>
-            <url>https://nexus.onap.org/content/repositories/snapshots/</url>
-        </repository>
-        <repository>
-            <id>nordix</id>
-            <name>39bf7eabe020-releases</name>
-            <url>https://artifactory.nordix.org/artifactory/onap-policy-clamp-participant-maven-local</url>
-        </repository>
     </repositories>
     <properties>
         <!-- Update this when a new version of the dependency jar shall be included -->
index 27f73c8..ba9c826 100644 (file)
@@ -1,7 +1,11 @@
 {
-    "releaseName": "simpleapp",
-    "chartName": "simple-app",
-    "version": "0.1.0",
+    "chartId": {
+      "name": "simple-app",
+      "version": "0.1.0"
+    },
     "namespace": "ckhm",
-    "repository": "cm"
-}
\ No newline at end of file
+    "repository": {
+      "repoName": "cm"
+    },
+    "releaseName": "simpleapp"
+  }
\ No newline at end of file
index 1b652bf..89c79da 100755 (executable)
@@ -34,6 +34,7 @@ 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"
+REPO_JSON="cm-repo.json"
 
 PORT=""
 HOST=""
@@ -43,7 +44,12 @@ NAMESPACE="ckhm"  #kube namespace for simple-app
 PROXY_TAG=""
 
 OK="All tests ok"
-
+USER=helmadmin
+#USER=""
+PWD=itisasecret
+#PWD=""
+PREFIX=/onap/k8sparticipant
+PREFIX=""
 print_usage() {
     echo "usage: ./test.sh docker|(kube <cluster-ip>)"
 }
@@ -51,7 +57,8 @@ if [ $# -eq 1 ]; then
     if [ $1 == "docker" ]; then
         PORT=8112
         HOST="localhost"
-        URL="http://$HOST:$PORT"
+        URL="http://$USER:$PWD@$HOST:$PORT"$PREFIX
+        #URL="http://$HOST:$PORT"$PREFIX
         HM_PATH=$URL
     else
         print_usage
@@ -61,7 +68,8 @@ 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"
+        URL="http://$USER:$PWD@$HOST:$PORT"$PREFIX
+        #URL="http://$HOST:$PORT"$PREFIX
         HM_PATH=$URL
     else
         print_usage
@@ -113,10 +121,18 @@ run-curl $cmd
 echo
 
 
+echo "================"
+echo "Add repo"
+echo "================"
+cmd="/helm/repo -X POST -H Content-Type:application/json -d @$REPO_JSON"
+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"
+cmd="/helm/onboard/chart -X POST -F chart=@$APP_TGZ -F values=@$VALUES_YAML -F info=<$INFO_JSON"
 run-curl $cmd
 echo
 
@@ -193,7 +209,7 @@ echo
 echo "============"
 echo "Delete chart"
 echo "==========="
-cmd="/helm/charts/simple-app/0.1.0 -X DELETE"
+cmd="/helm/chart/simple-app/0.1.0 -X DELETE"
 run-curl $cmd
 echo