• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.github/H22-Apr-2021-21

m4/H22-Apr-2021-297265

pkg/H22-Apr-2021-252160

src/H03-May-2022-5,7424,178

.gitignoreH A D22-Apr-2021385 5240

.travis.ymlH A D22-Apr-2021542 2417

COPYINGH A D22-Apr-202125 21

LICENSEH A D22-Apr-20211.3 KiB2522

Makefile.amH A D03-May-2022103 63

README.rstH A D22-Apr-20216.4 KiB214143

autogen.shH A D22-Apr-20211.1 KiB5748

configure.acH A D22-Apr-20211.7 KiB5949

README.rst

1============
2vmod-dynamic
3============
4
5This branch is for varnish master (post 6.5)
6
7Description
8===========
9
10This module provides a varnish director for dynamic creation of
11backends based on calls to
12
13* the system's network address resolution service which, in turn,
14  typically use information from the ``/etc/hosts`` file and the
15  Domain Name Service (DNS), but can be configured to use other
16  sources like LDAP (see :ref:`nsswitch.conf(5)`).
17
18* or more advanced DNS resolution where `getdns`_ is available.
19
20While standard varnish backends defined in VCL may also be defined in
21terms of host names, changes of the name service information will only
22be picked up with a VCL reload.
23
24In contrast, for dynamic backends provided by this module,
25
26* name resolution information will be refreshed by background threads
27  after a configurable time to live (ttl) or after the ttl from DNS
28  with a `getdns`_ `vmod_dynamic.resolver`_.
29
30* resolution to multiple network addresses is supported
31
32In addition, with a `getdns`_ `vmod_dynamic.resolver`_, service
33discovery by DNS SRV records is possible, in which case this module
34also allows to configure host names (*targets*), their ports, priority
35and weight though DNS. See https://en.wikipedia.org/wiki/SRV_record
36for a good basic explanation and `vmod_dynamic.director.service`_ for
37details.
38
39Further documentation is available in the manual page ``vmod_dynamic(3)``.
40
41.. _getdns: https://getdnsapi.net/
42
43Installation
44============
45
46The source tree is based on autotools to configure the building, and
47does also have the necessary bits in place to do functional unit tests
48using the ``varnishtest`` tool.
49
50For extended resolver functionality, `getdns`_ is required both during
51installation and at runtime. Before building, install `getdns`_ from
52source or install developer packages, e.g.::
53
54	apt-get install libgetdns-dev
55
56At runtime, only the library itself is required, e.g.::
57
58	apt-get install libgetdns1
59
60.. getdns: https://getdnsapi.net/
61
62Building requires the Varnish header files and uses pkg-config to find
63the necessary paths.
64
65Usage::
66
67 ./autogen.sh
68 ./configure
69
70If you have installed Varnish to a non-standard directory, call
71``autogen.sh`` and ``configure`` with ``PKG_CONFIG_PATH`` pointing to
72the appropriate path. For instance, when varnishd configure was called
73with ``--prefix=$PREFIX``, use
74
75::
76
77 export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
78 export ACLOCAL_PATH=${PREFIX}/share/aclocal
79
80The module will inherit its prefix from Varnish, unless you specify a
81different ``--prefix`` when running the ``configure`` script for this
82module.
83
84Make targets:
85
86* make - builds the vmod.
87* make install - installs your vmod.
88* make check - runs the unit tests in ``src/tests/*.vtc``.
89* make distcheck - run check and prepare a tarball of the vmod.
90
91If you build a dist tarball, you don't need any of the autotools, only
92pkg-config and Varnish. You can build the module simply by running::
93
94 ./configure
95 make
96
97For the test suite to work, please add this line to your ``/etc/hosts``::
98
99	127.0.0.1 www.localhost img.localhost
100
101then run::
102
103	make check
104
105Also, the service tests require direct access to public DNS (for now).
106
107Alternatively, the ``make check`` can also be skipped.
108
109You can then proceed with the installation::
110
111    sudo make install
112
113Installation directories
114------------------------
115
116By default, the vmod ``configure`` script installs the built vmod in the
117directory relevant to the prefix. The vmod installation directory can be
118overridden by passing the ``vmoddir`` variable to ``make install``.
119
120FreeBSD
121-------
122
123FreeBSD users may install from either the ports tree or via packages:
124
125* via the Ports Tree
126
127  ``cd /usr/ports/www/varnish-libvmod-dynamic/ && make install clean``
128
129* via the Package
130
131  ``pkg install varnish-libvmod-dynamic``
132
133RPMs
134----
135
136Binary, debuginfo and source RPMs for VMOD dynamic are available at::
137
138	https://pkg.uplex.de/
139
140The packages are built for Enterprise Linux 7 (el7), and hence will
141run on compatible distros (such as RHEL7, Fedora, CentOS 7 and Amazon
142Linux).
143
144To set up your YUM repository for the RPMs::
145
146	yum-config-manager --add-repo https://pkg.uplex.de/rpm/7/uplex-varnish/x86_64/
147
148The RPMs are compatible with Varnish versions 6.3.2 and 6.4.0. They
149also require the ``getdns`` library, as discussed above. The library
150is not necessarily available in the distributions' standard
151repositories, but can be installed from EPEL7::
152
153	yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
154
155If you have problems or questions concerning the RPMs, post an issue
156to one of the source repository web sites, or contact
157<varnish-support@uplex.de>.
158
159See also
160========
161
162If you want to learn more about DNS, you can start with `RFC 1034`_ and other
163RFCs that updated it over time. You may also have DNS already in place, or may
164be interested in setting up a name server in your infrastructure. Below is a
165non-exhaustive list of tools and services, but for free software name servers
166you can have a look at debianadmin_.
167
168.. _RFC 1034: https://tools.ietf.org/html/rfc1034
169.. _debianadmin: http://www.debianadmin.com/open-source-domain-name-systemdns-servers.html
170
171DNS in the cloud (in alphabetic order):
172
173- AWS_
174- Azure_
175- `Digital Ocean`_
176- `Google Cloud`_
177- Heroku_
178
179.. _AWS: https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/using-instance-addressing.html
180.. _Azure: https://azure.microsoft.com/en-us/documentation/articles/dns-overview/
181.. _Digital Ocean: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-host-name-with-digitalocean
182.. _Google Cloud: https://cloud.google.com/dns/
183.. _Heroku: https://devcenter.heroku.com/articles/zerigo_dns
184
185DNS and containers (in alphabetic order):
186
187* `DC/OS`_ (Mesos)
188* `Docker Machine`_ (sort of)
189* Kubernetes_
190
191.. _DC/OS: https://docs.mesosphere.com/1.7/usage/service-discovery/mesos-dns/
192.. _Docker Machine: https://www.npmjs.com/package/docker-machine-dns
193.. _Kubernetes: http://kubernetes.io/docs/admin/dns/
194
195ACKNOWLEDGEMENTS
196================
197
198We thank the various people and companies having made vmod_dynamic a
199reality:
200
201vmod_dynamic is based upon vmod_named developed and maintained from
2022015 to 2017 by Dridi Boukelmoune (github @dridi) and supported by
203Varnish Software.
204
205Maintenance and improvements 2017 - 2019 were sponsored by various
206unnamed UPLEX clients and authored by Geoffrey Simmons and Nils Goroll
207from UPLEX.
208
209SRV record support and getdns integration in 2019 was supported by
210GOG.com
211
212vmod_dynamic also contains contributions by: Ricardo Nabinger Sanchez,
213Ryan Steinmetz
214