A1Sim changes to make it more flexible
[it/dep.git] / smo-install / oran_oom / a1simulator / templates / service.yaml
index d22654c..a59e4fc 100644 (file)
@@ -1,41 +1,23 @@
-################################################################################
-#   Copyright (c) 2020 Nordix Foundation.                                      #
-#                                                                              #
-#   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.                                             #
-################################################################################
-
-kind: Service
+{{ range $i, $a1sim := .Values.a1Sims }}
+---
 apiVersion: v1
+kind: Service
 metadata:
-  name: {{ .Values.a1simulator.name }}
-  namespace: {{ include "common.namespace.nonrtric" . }}
+  name: "{{ $a1sim.name }}"
   labels:
-    app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.a1simulator" . }}
-    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ .Release.Name }}
-    heritage: {{ .Release.Service }}
+    sim-name: {{ $a1sim.name }}
+    release: {{ $.Release.Name }}
+    chart: {{ $.Chart.Name }}
 spec:
+  type: {{ $.Values.service.type }}
   ports:
-    - name: {{ index .Values.a1simulator.service.httpName }}
-      port: {{ .Values.a1simulator.service.internalPort1 }}
-      targetPort: {{ .Values.a1simulator.service.targetPort1 }}
-      protocol: TCP
-    - name: {{ index .Values.a1simulator.service.httpsName }}
-      port: {{ .Values.a1simulator.service.internalPort2 }}
-      targetPort: {{ .Values.a1simulator.service.targetPort2 }}
-      protocol: TCP
+    - name: http
+      port: {{ $.Values.service.ports.httpPort }}
+    - name: https
+      port: {{ $.Values.service.ports.httpsPort }}
   selector:
-    app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.a1simulator" . }}
-    release: {{ .Release.Name }}
-  type: ClusterIP
-  clusterIP: None
\ No newline at end of file
+    sim-name: {{ $a1sim.name }}
+    release: {{ $.Release.Name }}
+    chart: {{ $.Chart.Name }}
+
+{{ end }}