[AAI] Update Service definitions to support Ingress case
Fix the service definitions to automatically change NodePorts to
ClusterIPs in case of Ingress enabled
Issue-ID: OOM-3111
Signed-off-by: Andreas Geissler <andreas-geissler@telekom.de>
Change-Id: I27fbcc917190f1df3d39f1bfc789664bb55809a2
diff --git a/kubernetes/aai/components/aai-sparky-be/templates/service.yaml b/kubernetes/aai/components/aai-sparky-be/templates/service.yaml
index 9e3ffd6..10d9e2a 100644
--- a/kubernetes/aai/components/aai-sparky-be/templates/service.yaml
+++ b/kubernetes/aai/components/aai-sparky-be/templates/service.yaml
@@ -14,24 +14,4 @@
# limitations under the License.
*/}}
-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:
- ports:
- - name: {{ .Values.service.portName }}{{ if (include "common.needTLS" .) }}s{{ end }}
- port: {{ .Values.service.externalPort }}
- targetPort: {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.service.internalPort .Values.service.internalPlainPort }}
- {{- if eq .Values.service.type "NodePort" }}
- nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }}
- {{- end }}
- type: {{ .Values.service.type }}
- selector:
- app: {{ include "common.name" . }}
+{{ include "common.service" . }}