Refactor Policy PAP for common service template
Issue-ID: POLICY-2514
Signed-off-by: Bruno Sakoto <bruno.sakoto@bell.ca>
Change-Id: I3021081f3e9d1a3cec079fdaf4595689d25571fb
diff --git a/kubernetes/policy/charts/pap/templates/service.yaml b/kubernetes/policy/charts/pap/templates/service.yaml
index b6deb5c..5c4061e 100644
--- a/kubernetes/policy/charts/pap/templates/service.yaml
+++ b/kubernetes/policy/charts/pap/templates/service.yaml
@@ -18,28 +18,4 @@
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
-apiVersion: v1
-kind: Service
-metadata:
- name: {{ include "common.servicename" . }}
- namespace: {{ include "common.namespace" . }}
- labels:
- app: {{ include "common.name" . }}
- chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
- release: {{ include "common.release" . }}
- heritage: {{ .Release.Service }}
-spec:
- type: {{ .Values.service.type }}
- ports:
- {{if eq .Values.service.type "NodePort" -}}
- - port: {{ .Values.service.internalPort }}
- nodePort: {{ .Values.global.nodePortPrefixExt | default .Values.nodePortPrefixExt }}{{ .Values.service.nodePort }}
- name: {{ .Values.service.portName }}
- {{- else -}}
- - port: {{ .Values.service.externalPort }}
- targetPort: {{ .Values.service.internalPort }}
- name: {{ .Values.service.portName }}
- {{- end}}
- selector:
- app: {{ include "common.name" . }}
- release: {{ include "common.release" . }}
+{{ include "common.service" . }}