Overriding nfProfile Fields
A common requirement is having a common nfProfile
for all environments where a few values can be overridden for each environment. This can be achieved using the global
variables section of the common configuration.
The following example sets nfIntanceIds
to a different value in a second
environment:
- Define static named variables, in this example
NF_INSTANCE_ID
, in your nf.yaml, with default values. - Define
registrationVariables
innf.yaml
. This applies the variable in the right place in thenfProfile
JSON. - Override the value of the variable in your environment variables or nf.yaml configuration with values from a configuration source.
For more information about the variables section of the common configuration, see the discussions about the common SBA configuration and polling the Prometheus REST API. For more information about configuration sources, see the discussion about configuration sources in MATRIXX Configuration.
The following nfProfile
example specifies
bfc50e58-f6df-49dd-a1f0-d3b66163edb9
with the
nfInstanceId
property:
nfInstanceId: bfc50e58-f6df-49dd-a1f0-d3b66163edb9
nfType: CHF
nfStatus: REGISTERED
sNssais:
- sst: 1
fqdn: chf1.webscale.com:33102
ipv4Addresses:
- 10.31.136.62
nfServices:
- serviceInstanceId: CHFService1
serviceName: nchf-convergedcharging
versions:
- apiVersionInUri: v2
apiFullVersion: 15.2009.9
scheme: http
nfServiceStatus: Running
allowedNfTypes:
- SMF
priority: 9
heartBeatTimer: 60
The following nf.yaml
file configuration is common to all environments in this example. This configuration creates a static variable, NF_INSTANCE_ID
, and
uses the registrationVariable
property to set a NF_INSTANCE_ID
variable with the value of the nfInstanceId
field (the default value) in
the in the nfProfile
. The NF_INSTANCE_ID variable can be used (in other contexts) to override the value in the nfProfile
.
variables:
static:
-
name: NF_INSTANCE_ID
value: "bfc50e58-f6df-49dd-a1f0-d3b66163edb9"
nrf:
registrationVariables:
-
jsonPath: $
field: nfInstanceId
variable: NF_INSTANCE_ID
The following excerpt from a Helm values file uses NF_INSTANCE_ID
to override the nfInstanceId value for a second environment:
sba-5gc-chf:
configuration:
container:
environment:
- name: "variables.NF_INSTANCE_ID"
value: "c101dc58-e1b5-42e8-95bd-ce6e2973a802"