Template
Change the default templates mounting a new template file using a ConfigMap. Note that in the current version, updates to the ConfigMap will not update the in-memory parsed template.
All templates support Sprig template library. This library provides a group of commonly used template functions to work with dictionaries, lists, math etc.
Starting from v0.11, all template files were moved from /etc/haproxy to /etc/templates. Change to an older doc version if using N42 Gateway up to v0.10.
Overwriting a template file:
- The links below reference the
masterbranch, change to the same tag of your N42 Gateway version. - Change to the
Rawview - Copy the whole file and edit it to fit your needs
- Paste the content to a ConfigMap, use the file name as the content key
- Mount the ConfigMap into the Mounting directory (see below) of the N42 Gateway pod
Consider overwriting the template files as a last resort. Templates change a lot between N42 Gateway versions and the overwrite should be updated on every controller update. Try to use a configuration snippet instead or file a new feature request.
| Mounting directory (v0.11+) | ConfigMap keys | Source (v0.11+) | Source (up to v0.10) |
|---|---|---|---|
/etc/templates/haproxy |
haproxy.tmpl |
haproxy.tmpl | haproxy.tmpl |
/etc/templates/modsecurity |
modsecurity.tmpl |
modsecurity.tmpl | spoe-modsecurity.tmpl |