blob: d93d7399e78624f7ee460530370a6b6ad04d88d3 [file] [log] [blame]
Badhrinath987e1d82020-11-20 13:23:58 -06001{{/*
2# Copyright 2020-present Open Networking Foundation
3
4# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
5*/}}
6
7{{- if .Values.config.nrf.deploy }}
Hyunsun Moon6a651482021-02-26 01:46:44 -08008
Hyunsun Moonc73636b2021-03-24 15:47:08 -07009{{- if not .Values.config.useExistingConfigMap -}}
Hyunsun Moon6a651482021-02-26 01:46:44 -080010{{- $nrfcfg := index .Values.config.nrf.cfgFiles "nrfcfg.conf" }}
11{{- $config := index $nrfcfg "configuration" }}
12{{- $sbi := index $config "sbi" }}
13
14{{- if not (hasKey $config "MongoDBName") -}}
15{{- $_ := .Values.config.mongodb.name | set $config "MongoDBName" -}}
16{{- end }}
Ajay Lotan Thakuref182f42021-05-25 16:41:19 -050017
Hyunsun Moon6a651482021-02-26 01:46:44 -080018{{- if not (hasKey $config "MongoDBUrl") -}}
19{{- $_ := .Values.config.mongodb.url | set $config "MongoDBUrl" -}}
20{{- end }}
Ajay Lotan Thakuref182f42021-05-25 16:41:19 -050021
Hyunsun Moon6a651482021-02-26 01:46:44 -080022{{- if not (hasKey $config "DefaultServiceIP") -}}
23{{- $_ := "POD_IP" | set $config "DefaultServiceIP" -}}
24{{- end }}
25
Ajay Lotan Thakuref182f42021-05-25 16:41:19 -050026{{- if not (hasKey $nrfcfg "logger") -}}
27{{- $_ := .Values.config.logger | set $nrfcfg "logger" -}}
28{{- end }}
29
Hyunsun Moon6a651482021-02-26 01:46:44 -080030{{- if not (hasKey $sbi "port") -}}
31{{- $_ := .Values.config.nrf.sbi.port | set $sbi "port" -}}
32{{- end }}
Hyunsun Moonc73636b2021-03-24 15:47:08 -070033{{- end }}
Hyunsun Moon6a651482021-02-26 01:46:44 -080034
Badhrinath987e1d82020-11-20 13:23:58 -060035---
36apiVersion: v1
37kind: ConfigMap
38metadata:
39 name: nrf
40 labels:
41{{ tuple "nrf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
42data:
43 nrf-run.sh: |
44{{ tuple "bin/_nrf-run.sh.tpl" . | include "5g-control-plane.template" | indent 4 }}
Hyunsun Moonc73636b2021-03-24 15:47:08 -070045{{- if not .Values.config.useExistingConfigMap -}}
Hyunsun Moon6a651482021-02-26 01:46:44 -080046{{- range $key, $value := .Values.config.nrf.cfgFiles }}
Badhrinath987e1d82020-11-20 13:23:58 -060047 {{ $key }}: |-
48{{ toYaml $value | indent 4 }}
49{{- end }}
50{{- end }}
Hyunsun Moonc73636b2021-03-24 15:47:08 -070051{{- end }}