[RFC] using environment variables for configuration

Guillaume Quintard guillaume.quintard at gmail.com
Wed Jan 22 18:45:08 UTC 2025


Hello everyone!

One of my goals for 2025 is to make Varnish easier to operate Varnish in
dynamic environments, so I'm ready to open a big can of worms:
configuration through environment variables.

Yes, env variables are terrible, but they are the primary configuration
mode for containers and they also allow users to redefine part of the
configuration without having to rewrite the whole command line.
Notably, docker images and helm charts use them to configure varnishd but
they have to reimplement everything all the time (variable names, ordering,
etc.), and having the feature in core would simplify downstream integration
and bring some standardization, lowering the barrier of entry.

In practice, I have relatively modest initial goals:
- have varnishd read a handful of variables such as VARNISH_LISTEN_HTTP,
VARNISH_STORAGE_MALLOC, VARNISH_VCL_PATH, VARNISH_HTTP2, and
VARNISH_PARAMETER_* for all the -p arguments
- those would be processed before regular command line arguments
- possibly scan the environment looking for unsupported VARNISH_* variables
to detect user error

This is a pretty vague plan right now, but I'd rather telegraph it than
implement it and be blocked during the PR review :-)

So, how heretical am I being here?

-- 
Guillaume Quintard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20250122/d8003024/attachment.html>


More information about the varnish-misc mailing list