AETHER-2075 [5g-control-plane] Fix monitoring target down alerts
Removed Prometheus service monitor annotation and ports for unimplemented NFs.
Also, refactored Service template.
Change-Id: I105e4ae05baf4f819c881c7e1c6b74064b0a7d6b
diff --git a/omec/5g-control-plane/templates/service-nssf.yaml b/omec/5g-control-plane/templates/service-nssf.yaml
index d92d524..4bcfcde 100644
--- a/omec/5g-control-plane/templates/service-nssf.yaml
+++ b/omec/5g-control-plane/templates/service-nssf.yaml
@@ -13,40 +13,16 @@
labels:
{{ tuple "nssf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
spec:
- type: ClusterIP
+ type: {{ .Values.config.nssf.serviceType }}
selector:
{{ tuple "nssf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
ports:
- - name: prometheus-exporter
- port: {{ .Values.config.nssf.prometheus.port }}
- protocol: TCP
- name: sbi
port: {{ .Values.config.nssf.sbi.port }}
protocol: TCP
-{{- if or .Values.config.nssf.prometheus.nodePort.enabled .Values.config.nssf.sbi.nodePort.enabled }}
----
-apiVersion: v1
-kind: Service
-metadata:
- name: nssf-external
- labels:
-{{ tuple "nssf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
-spec:
- type: NodePort
- selector:
-{{ tuple "nssf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
- ports:
-{{- if .Values.config.nssf.prometheus.nodePort.enabled }}
- - name: prometheus-exporter
- port: {{ .Values.config.nssf.prometheus.port }}
- protocol: TCP
- nodePort: {{ .Values.config.nssf.prometheus.nodePort.port }}
-{{- end }}
-{{- if .Values.config.nssf.sbi.nodePort.enabled }}
- - name: sbi
- port: {{ .Values.config.nssf.sbi.port }}
- protocol: TCP
- nodePort: {{ .Values.config.nssf.sbi.nodePort.port }}
+{{- if eq .Values.config.nssf.serviceType "NodePort" }}
+{{- if .Values.config.nssf.sbi.nodePort }}
+ nodePort: {{ .Values.config.nssf.sbi.nodePort }}
{{- end }}
{{- end }}
{{- end }}