blob: 5841f2273f6f770e5b54b415860b2c5c26d9de5e [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 }}
17{{- if not (hasKey $config "MongoDBUrl") -}}
18{{- $_ := .Values.config.mongodb.url | set $config "MongoDBUrl" -}}
19{{- end }}
20{{- if not (hasKey $config "DefaultServiceIP") -}}
21{{- $_ := "POD_IP" | set $config "DefaultServiceIP" -}}
22{{- end }}
23
24{{- if not (hasKey $sbi "registerIPv4") -}}
25{{- $_ := "POD_IP" | set $sbi "registerIPv4" -}}
26{{- end }}
27{{- if not (hasKey $sbi "bindingIPv4") -}}
28{{- $_ := "POD_IP" | set $sbi "bindingIPv4" -}}
29{{- end }}
30{{- 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 }}