summaryrefslogtreecommitdiffstats
path: root/modules/etcd/README.rst
blob: 0ffa7817b75548aa66dd6a0f6b6c96bc97422fe0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
.. SPDX-License-Identifier: GPL-3.0-or-later

.. _mod-etcd:

Etcd support
------------

The `etcd` module connects to `etcd <https://etcd.io/>`_ peers and watches
for configuration changes. By default, the module watches the subtree under
``/knot-resolver`` directory, but you can change this in the
`etcd library configuration <https://github.com/mah0x211/lua-etcd#cli-err--etcdnew-optiontable->`_.

The subtree structure corresponds to the configuration variables in the declarative style.

.. code-block:: bash

	$ etcdctl set /knot-resolver/net/127.0.0.1 53
	$ etcdctl set /knot-resolver/cache/size 10000000

Configures all listening nodes to following configuration:

.. code-block:: lua

	net = { '127.0.0.1' }
	cache.size = 10000000

Example configuration
^^^^^^^^^^^^^^^^^^^^^

.. code-block:: lua

	modules.load('etcd')
        etcd.config({
                prefix = '/knot-resolver',
                peer = 'http://127.0.0.1:7001'
        })

.. warning:: Work in progress!

Dependencies
^^^^^^^^^^^^

* `lua-etcd <https://github.com/mah0x211/lua-etcd>`_ library available in LuaRocks

    ``$ luarocks --lua-version 5.1 install etcd --from=https://mah0x211.github.io/rocks/``