X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=xapp_onboarder%2Fxapp_onboarder%2Fresources%2Fxapp-std%2Ftemplates%2Fdeployment.yaml;h=65c2c5de3cbff149498adf14a45d3123241fd338;hb=907b38feb3b874e49645488b1e94c11d252c9c08;hp=48be8c5367d56d2d75b79facb0c73f4b5e96bbd7;hpb=3b56acc14a2308e853612e22738cd44687288149;p=it%2Fdev.git diff --git a/xapp_onboarder/xapp_onboarder/resources/xapp-std/templates/deployment.yaml b/xapp_onboarder/xapp_onboarder/resources/xapp-std/templates/deployment.yaml index 48be8c5..65c2c5d 100644 --- a/xapp_onboarder/xapp_onboarder/resources/xapp-std/templates/deployment.yaml +++ b/xapp_onboarder/xapp_onboarder/resources/xapp-std/templates/deployment.yaml @@ -30,8 +30,20 @@ spec: release: {{ .Release.Name }} template: metadata: + {{- if .Values.annotations }} + annotations: + {{- range $key, $value := .Values.annotations }} + {{- if kindIs "string" $value }} + {{ $key }}: {{ $value | toPrettyJson }} + {{- else }} + {{ $key }}: | +{{- $value | toPrettyJson | nindent 10 }} + {{- end }} + {{- end -}} + {{ end }} labels: app: {{ include "ricxapp.namespace" . }}-{{ include "ricxapp.name" . }} + kubernetes_name: {{ include "ricxapp.namespace" . }}_{{ include "ricxapp.name" . }} release: {{ .Release.Name }} spec: hostname: {{ include "ricxapp.name" . }} @@ -44,31 +56,46 @@ spec: configMap: name: {{ include "ricxapp.configmapname" . }}-appconfig containers: -{{- range .Values.containers }} - - name: {{ .name }} - image: "{{ .image.registry }}/{{ .image.name }}:{{ .image.tag }}" - {{- if .command }} - command: [{{ .command }}] +{{- $containers := .Values.containers }} +{{- $ports := .Values.messaging.ports }} +{{- range $container := $containers }} + {{- $portlist := list }} + {{- range $port := $ports }} + {{- if eq $port.container $container.name }} + {{- $portlist = append $portlist $port }} + {{- end }} + {{- end }} + - name: {{ $container.name }} + image: "{{ $container.image.registry }}/{{ $container.image.name }}:{{ $container.image.tag }}" + {{- if $container.command }} + command: [ + {{- range $command := $container.command -}} + {{- $command | quote -}} + {{- if ne $command (last $container.command) }} + {{- print ", " -}} + {{- end -}} + {{- end -}} + {{- print "]" -}} + {{- end}} + {{- if $container.args }} + args: [ + {{- range $arg := $container.args -}} + {{- $arg | quote -}} + {{- if ne $arg (last $container.args) }} + {{- print ", " -}} + {{- end -}} + {{- end -}} + {{- print "]" -}} {{- end}} imagePullPolicy: {{ $.Values.image_pull_policy }} - {{- if .ports }} + {{- if $portlist }} ports: - {{- if .ports.http }} - - name: http_{{ .name }} - containerPort: {{ .ports.http }} - protocol: TCP - {{- end }} - {{- if .ports.rmr_data }} - - name: rmrdata_{{ .name }} - containerPort: {{ .ports.rmr_data }} + {{- range $port := $portlist }} + - name: {{ $port.name }} + containerPort: {{ $port.port }} protocol: TCP - {{- end }} - {{- if .ports.rmr_route }} - - name: rmrroute_{{ .name }} - containerPort: {{ .ports.rmr_route }} - protocol: TCP - {{- end }} - {{- end }} + {{- end }} + {{- end }} {{- end }} volumeMounts: - name: config-volume @@ -76,4 +103,6 @@ spec: envFrom: - configMapRef: name: {{ include "ricxapp.configmapname" . }}-appenv + - configMapRef: + name: dbaas-appconfig restartPolicy: Always