Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Customize JCNR Configuration using Node Annotations

SUMMARY Read this topic to understand how to customize JCNR configuration using node annotations and custom configuration template.

Node Annotations

Starting with Juniper Cloud-Native Router (JCNR) Release 23.2, JCNR supports customizing the JCNR configurations using node annotations when deployed in L3 mode. Node annotations are key-value pairs. The key-value pairs are used to render the cRPD configuration via a go template. The configured template must be available in the Juniper_Cloud_Native_Router_release_number/helmchart/charts/jcnr-cni/files/ directory for the configuration to be applied to the cRPD pods.
Note:

You must apply the node annotations before installing JCNR to create cRPD pods with custom configuration. The cRPD pod must be deleted and respawned should you wish to apply the annotations any time after JCNR installation. cRPD customization via node annotations is optional.

Configuration Example

Sample node annotation and template files are available under Juniper_Cloud_Native_Router_<release-number>/helmchart/cRPD_examples directory.

You define the key-value pair for each worker node of your cluster. An example of the node-annotations.yaml file is provided below:

The key-value pairs you define in the annotations is used to render the cRPD configuration via a go template. An example of the jcnr-cni-custom-config.tmpl template file is provided below:

Note:

You can define additional cRPD configuration hierarchies in the template. The values to be rendered from the annotations defined in the node-annotations.yaml must be defined as {{.Node.key}}. Any environment variables, such as variables defined in values.yaml, must be defined as {{.Env.variable_name}}.

Once the template is configured, you must copy the jcnr-cni-custom-config.tmpl file to the Juniper_Cloud_Native_Router_release_number/helmchart/charts/jcnr-cni/files/ directory.

Apply the node annotations to the cluster nodes using the command provided below:

Follow the JCNR installation instructions to deploy the cloud-native router components, including the cRPD. Once the installation completes, access the cRPD shell and issue the show configuration | display set command in the cli mode to view the custom configuration you applied.

Troubleshooting

The cRPD pod continues to remain in Pending state if invalid configuration is rendered and applied via the go template. The rendered configuration is saved in /etc/crpd directory on the JCNR host as juniper.conf.master. You can apply the rendered configuration manually to a running cRPD pod to validate the configuration and identify issues. For an AWS EKS deployment you can find the rendered config within the cRPD pod in the /config directory.