k8s solution: fix issues with pm-metric-service 99/13499/6 master
authorAlex Dehn <alexander.dehn@highstreet-technologies.com>
Tue, 1 Oct 2024 11:56:14 +0000 (11:56 +0000)
committerMartin Skorupski <martin.skorupski@highstreet-technologies.com>
Wed, 2 Oct 2024 10:42:40 +0000 (10:42 +0000)
Issue-ID: OAM-419
Change-Id: If0ba7900167b5207bf58f63ea0a86e97d1d88732
Signed-off-by: Alexander Dehn <alexander.dehn@highstreet-technologies.com>
12 files changed:
solution_k8s/Makefile
solution_k8s/application/deploy-pm-ms.sh [moved from solution_k8s/metrics/deploy-pm-ms.sh with 97% similarity]
solution_k8s/application/helm/pm-metric-service/.helmignore [moved from solution_k8s/metrics/helm/pm-metric-service/.helmignore with 100% similarity]
solution_k8s/application/helm/pm-metric-service/Chart.yaml [moved from solution_k8s/metrics/helm/pm-metric-service/Chart.yaml with 100% similarity]
solution_k8s/application/helm/pm-metric-service/templates/_helpers.tpl [moved from solution_k8s/metrics/helm/pm-metric-service/templates/_helpers.tpl with 100% similarity]
solution_k8s/application/helm/pm-metric-service/templates/deployment.yaml [moved from solution_k8s/metrics/helm/pm-metric-service/templates/deployment.yaml with 100% similarity]
solution_k8s/application/helm/pm-metric-service/templates/kafka-user-pm.yaml [moved from solution_k8s/metrics/helm/pm-metric-service/templates/kafka-user-pm.yaml with 100% similarity]
solution_k8s/application/helm/pm-metric-service/templates/service.yaml [moved from solution_k8s/metrics/helm/pm-metric-service/templates/service.yaml with 100% similarity]
solution_k8s/application/helm/pm-metric-service/templates/serviceaccount.yaml [moved from solution_k8s/metrics/helm/pm-metric-service/templates/serviceaccount.yaml with 100% similarity]
solution_k8s/application/helm/pm-metric-service/templates/tests/test-connection.yaml [moved from solution_k8s/metrics/helm/pm-metric-service/templates/tests/test-connection.yaml with 100% similarity]
solution_k8s/application/helm/pm-metric-service/values.yaml [moved from solution_k8s/metrics/helm/pm-metric-service/values.yaml with 100% similarity]
solution_k8s/metrics/helm/pm-metric-service/templates/NOTES.txt [deleted file]

index 1b5991f..cd0b1c5 100644 (file)
@@ -37,13 +37,11 @@ prepare-templates:
        # for metrics and smo stack
        (cd application; ./setup-smo-template.sh)
 
-
-
 ## create-infrastructure: Create kubernetes all-in one infrastructure
 .PHONY: create-infrastructure
 create-infrastructure:
 # TODO: create kubeone.yaml from template file
-
+    
        (cd infrastructure; kubeone apply -m kubeone.yaml)
        (cd infrastructure; mkdir -p ~/.kube; cp o-ran-sc-test-cluster-kubeconfig ~/.kube/config)
        kubectl wait --for=condition=ready node -l node-role.kubernetes.io/control-plane=
@@ -69,32 +67,60 @@ deploy-smo:
        kubectl wait --for=condition=ready pod -l app.kubernetes.io/name=sdnc-web --timeout 1800s --namespace onap
        (cd application;  ./patch-pmbulk.sh)
 
-## undeploy-smo: Un-Deploys SMO
+## undeploy-smo: Un-Deploys SMO 
 .PHONY: undeploy-smo
 undeploy-smo:
        helm undeploy onap -n onap
        for topic in $$(kubectl get kafkatopic -n onap -o name); do   kubectl patch $$topic -n onap --type=json -p '[{"op": "remove", "path": "/metadata/finalizers"}]'; done
        kubectl delete ns onap
        sudo rm -rf /dockerdata-nfs/onap
-
+       
 ## deploy-metric: Deploys grafana and influxdb for PM data
 .PHONY: deploy-metric
 deploy-metric:
        (cd metrics; ./deploy-metric-stack.sh )
-       (cd metrics; ./deploy-pm-ms.sh )
+       (cd application; ./deploy-pm-ms.sh )
 
 ## undeploy-metric: Deploys grafana and influxdb for PM data
 .PHONY: undeploy-metric
 undeploy-metric:
        (cd metrics; ./undeploy-metric-stack.sh )
-       helm uninstall -n metric pm-metric-service
+       helm uninstall -n onap pm-metric-service
 
 ## deploy-test-nfs: Deploys test network functions
 .PHONY: deploy-test-nfs
 deploy-test-nfs:
        (cd tests/network-simulation; ./start-network-simulation.sh )
 
-## undeploy-test-nfs: un-deploys test network functions
-.PHONY: undeploy-test-nfs
-undeploy-test-nfs:
-       (cd tests/network-simulation; ./stop-network-simulation.sh )
+
+## get-deploy-info: returns list of useful information
+.PHONY: get-deploy-info
+get-deploy-info:
+       @echo "FQDN and passwords for services"
+       @echo "Grafana Dashboard:"
+       @kubectl get ingress -o custom-columns="NAME:.metadata.name,HOSTS:.spec.rules[].host" -n metric |grep grafana
+       @echo "Grafana Credentials:"
+       @echo user: $$(kubectl get secret --namespace metric onap-grafana -o jsonpath="{.data.admin-user}" | base64 --decode ; echo)
+       @echo password: $$(kubectl get secret --namespace metric onap-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo)
+       @echo
+       @echo "SMO RESTCONF ODLUX:"
+       @kubectl get ingress -o custom-columns="NAME:.metadata.name,HOSTS:.spec.rules[].host" -n onap |grep sdnc
+       @echo user: $$(kubectl get secret --namespace onap onap-sdnc-odl-creds -o jsonpath="{.data.login}" | base64 --decode ; echo)
+       @echo password: $$(kubectl get secret --namespace onap onap-sdnc-odl-creds -o jsonpath="{.data.password}" | base64 --decode ; echo)
+       @echo
+       @echo "SMO O1-VES-Collector:"
+       @kubectl get ingress -o custom-columns="NAME:.metadata.name,HOSTS:.spec.rules[].host" -n onap |grep ves
+       @VES_USER=$$(kubectl get secret --namespace onap onap-sdnc-ves-collector-secret -o jsonpath="{.data.login}" | base64 --decode);\
+       VES_PASSWORD=$$(kubectl get secret --namespace onap onap-sdnc-ves-collector-secret -o jsonpath="{.data.password}" | base64 --decode ; echo);\
+       echo user: $$VES_USER; \
+       echo password: $$VES_PASSWORD;\
+       echo example for ves-collector end point: https://$$VES_USER:$$VES_PASSWORD@$$(kubectl get ingress -o custom-columns="HOSTS:.spec.rules[].host" -n onap |grep ves)/eventListener/v7 \
+
+
+
+
+
+       
+
+
+
similarity index 97%
rename from solution_k8s/metrics/deploy-pm-ms.sh
rename to solution_k8s/application/deploy-pm-ms.sh
index 76cf75f..030ba05 100755 (executable)
@@ -18,7 +18,7 @@
 # - converts stddefined file ready messages to legacy ves file readymessage and publishs to kafka
 # - get 3GPP pm data from kafka topics and publishs to influxdb
 set -x
-export METRIC_NAMESPACE=metric
+export METRIC_NAMESPACE=onap
 influxdbpass=$(kubectl get secret -n metric onap-influxdb2-auth -o jsonpath='{.data.admin-password}' | base64 -d)
 influxdbtoken=$(kubectl get secret -n metric onap-influxdb2-auth -o jsonpath='{.data.admin-token}' | base64 -d)
 cd helm
diff --git a/solution_k8s/metrics/helm/pm-metric-service/templates/NOTES.txt b/solution_k8s/metrics/helm/pm-metric-service/templates/NOTES.txt
deleted file mode 100644 (file)
index 67a35ed..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-1. Get the application URL by running these commands:
-{{- if .Values.ingress.enabled }}
-{{- range $host := .Values.ingress.hosts }}
-  {{- range .paths }}
-  http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
-  {{- end }}
-{{- end }}
-{{- else if contains "NodePort" .Values.service.type }}
-  export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "pm-metric-service.fullname" . }})
-  export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
-  echo http://$NODE_IP:$NODE_PORT
-{{- else if contains "LoadBalancer" .Values.service.type }}
-     NOTE: It may take a few minutes for the LoadBalancer IP to be available.
-           You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "pm-metric-service.fullname" . }}'
-  export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "pm-metric-service.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
-  echo http://$SERVICE_IP:{{ .Values.service.port }}
-{{- else if contains "ClusterIP" .Values.service.type }}
-  export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "pm-metric-service.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
-  export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
-  echo "Visit http://127.0.0.1:8080 to use your application"
-  kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
-{{- end }}