AETHER-3384 Allow external IP and various types for OMEC services
Change-Id: I95bb175d452d2c9e8e3610fb757cbfd9939731c9
diff --git a/omec-control-plane/templates/service-pcrf.yaml b/omec-control-plane/templates/service-pcrf.yaml
index 5058b19..79e0a28 100644
--- a/omec-control-plane/templates/service-pcrf.yaml
+++ b/omec-control-plane/templates/service-pcrf.yaml
@@ -13,69 +13,41 @@
labels:
{{ tuple "pcrf" . | include "omec-control-plane.metadata_labels" | indent 4 }}
spec:
+ type: {{ .Values.config.pcrf.serviceType }}
+{{- if .Values.config.pcrf.externalIP }}
+ externalIPs:
+ - {{ .Values.config.pcrf.externalIP }}
+{{- end }}
+{{- if eq .Values.config.pcrf.serviceType "LoadBalancer" }}
+{{- if .Values.config.pcrf.loadBalancerIP }}
+ loadBalancerIP: {{ .Values.config.pcrf.loadBalancerIP }}
+{{- end }}
+{{- end }}
selector:
{{ tuple "pcrf" . | include "omec-control-plane.metadata_labels" | indent 4 }}
ports:
- name: gx
port: 3868
protocol: TCP
+{{- if eq .Values.config.pcrf.serviceType "NodePort" }}
+{{- if .Values.config.pcrf.gx.nodePort }}
+ nodePort: {{ .Values.config.pcrf.gx.nodePort }}
+{{- end }}
+{{- end }}
- name: prometheus-exporter
port: {{ .Values.config.pcrf.prometheus.port }}
protocol: TCP
+{{- if eq .Values.config.pcrf.serviceType "NodePort" }}
+{{- if .Values.config.pcrf.prometheus.nodePort }}
+ nodePort: {{ .Values.config.pcrf.prometheus.nodePort }}
+{{- end }}
+{{- end }}
- name: config-port
port: {{ .Values.config.pcrf.configPort.port }}
protocol: TCP
----
-apiVersion: v1
-kind: Service
-metadata:
- name: pcrf-headless
- labels:
-{{ tuple "pcrf" . | include "omec-control-plane.metadata_labels" | indent 4 }}
-spec:
- selector:
-{{ tuple "pcrf" . | include "omec-control-plane.metadata_labels" | indent 4 }}
- clusterIP: None
- ports:
- - name: gx
- port: 3868
- protocol: TCP
- - name: prometheus-exporter
- port: {{ .Values.config.pcrf.prometheus.port }}
- protocol: TCP
- - name: config-port
- port: {{ .Values.config.pcrf.configPort.port }}
- protocol: TCP
-{{- if or (.Values.config.pcrf.prometheus.nodePort.enabled) (.Values.config.pcrf.gx.nodePort.enabled) }}
----
-apiVersion: v1
-kind: Service
-metadata:
- name: pcrf-external
- labels:
-{{ tuple "pcrf" . | include "omec-control-plane.metadata_labels" | indent 4 }}
-spec:
- selector:
-{{ tuple "pcrf" . | include "omec-control-plane.metadata_labels" | indent 4 }}
- type: NodePort
- ports:
- {{- if .Values.config.pcrf.prometheus.nodePort.enabled }}
- - name: prometheus-exporter
- port: {{ .Values.config.pcrf.prometheus.port }}
- protocol: TCP
- nodePort: {{ .Values.config.pcrf.prometheus.nodePort.port }}
- {{- end }}
- {{- if .Values.config.pcrf.gx.nodePort.enabled }}
- - name: gx
- port: 3868
- protocol: TCP
- nodePort: {{ .Values.config.pcrf.gx.nodePort.port }}
- {{- end }}
- {{- if .Values.config.pcrf.configPort.nodePort.enabled }}
- - name: config-port
- port: {{ .Values.config.pcrf.configPort.port }}
- protocol: TCP
- nodePort: {{ .Values.config.pcrf.configPort.nodePort.port }}
- {{- end }}
+{{- if eq .Values.config.pcrf.serviceType "NodePort" }}
+{{- if .Values.config.pcrf.configPort.nodePort }}
+ nodePort: {{ .Values.config.pcrf.configPort.nodePort }}
+{{- end }}
{{- end }}
{{- end }}