E2T: Prometheus integration 13/4413/1
authorFuss, Areli (af732p) <areli.fuss@intl.att.com>
Sun, 19 Jul 2020 15:40:38 +0000 (18:40 +0300)
committerFuss, Areli (af732p) <areli.fuss@intl.att.com>
Sun, 19 Jul 2020 15:40:38 +0000 (18:40 +0300)
Add e2term prometheus services discovery

Issue-ID: RIC-576
Signed-off-by: Fuss, Areli (af732p) <areli.fuss@intl.att.com>
Change-Id: I09498c5bd319af5db887ae1bdac95045204b2403

helm/e2term/templates/deployment.yaml
helm/e2term/templates/service-prometheus.yaml [new file with mode: 0644]

index b2aae0f..1a09e62 100644 (file)
@@ -133,7 +133,9 @@ spec:
               containerPort: {{ include "common.serviceport.e2term.rmr.data" $topCtx }}
             - name: "sctp-{{ $key }}"
               containerPort: 36422
-              protocol: SCTP 
+              protocol: SCTP
+            - name: "prmts-{{ $key }}"
+              containerPort: {{ include "common.serviceport.e2term.prometheus" $topCtx }}
           stdin: true
           tty: true
           securityContext:
diff --git a/helm/e2term/templates/service-prometheus.yaml b/helm/e2term/templates/service-prometheus.yaml
new file mode 100644 (file)
index 0000000..1810e81
--- /dev/null
@@ -0,0 +1,47 @@
+################################################################################
+#   Copyright (c) 2019 AT&T Intellectual Property.                             #
+#   Copyright (c) 2019 Nokia.                                                  #
+#                                                                              #
+#   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.                                             #
+################################################################################
+{{- $topCtx :=  . }} 
+{{- range keys .Values.e2term }} 
+{{- $key := . }} 
+{{- with index $topCtx.Values.e2term . }}
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: {{ include "common.servicename.e2term.prometheus" $topCtx }}-{{ $key }}
+  namespace: {{ include "common.namespace.platform" $topCtx }}
+  labels:
+    app: {{ include "common.namespace.platform" $topCtx }}-{{ include "common.name.e2term" $topCtx }}-{{ $key }}
+    chart: {{ $topCtx.Chart.Name }}-{{ $topCtx.Chart.Version | replace "+" "_" }}
+    release: {{ $topCtx.Release.Name }}
+    heritage: {{ $topCtx.Release.Service }}
+  annotations:
+    prometheus.io/scrape: "true"
+    prometheus.io/path: "/metrics"
+    prometheus.io/port: {{ include "common.serviceport.e2term.prometheus" $topCtx | quote }}
+spec:
+  type: ClusterIP
+  ports:
+    - port: {{ include "common.serviceport.e2term.prometheus" $topCtx }}
+      protocol: "TCP"
+      targetPort: "prmts-{{ $key }}"
+      name: "prmts-{{ $key }}"
+  selector:
+      app: {{ include "common.namespace.platform" $topCtx }}-{{ include "common.name.e2term" $topCtx }}-{{ $key }}
+      release: {{ $topCtx.Release.Name }}
+{{- end }}
+{{- end }}