Consul: Difference between revisions

imported>Zie
m minor note about the config snippet.
Pigs (talk | contribs)
Consul: Use current channel for search.nixos.org link
Tags: Mobile edit Mobile web edit Advanced mobile edit
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Consul ==
Consul by Hashicorp is a distributed key/value store along with other things.
Consul by Hashicorp is a distributed key/value store along with other things.


Line 7: Line 8:
</syntaxhighlight>
</syntaxhighlight>


But there are some [https://search.nixos.org/options?channel=20.09&from=0&size=30&sort=relevance&query=services.consul.|consul specific options] that might be useful.
But there are some [https://search.nixos.org/options?query=services.consul consul specific options] that might be useful.


Setting up Consul in a production setting is beyond the scope of this wiki, see the consul documentation for particulars.
Setting up Consul in a production setting is beyond the scope of this wiki, see the consul documentation for particulars.


## Consul-template
One advice is that if you have systemd services depending on Consul via <code>After=consul.service</code>, you may want to switch consul service type no <code>notify</code>, to make sure that dependent services don't try to run until Consul is ready to accept connections:
 
<syntaxhighlight lang="nix">
  systemd.services.consul.serviceConfig.Type = "notify";
</syntaxhighlight>
 
== Consul-template ==


currently consul-template is packaged, but does not have nixos options to configure it. Here is an haproxy example that might prove useful:
currently consul-template is packaged, but does not have nixos options to configure it. Here is an haproxy example that might prove useful:
Line 62: Line 69:
systemd.services.haproxy-config.enable = true;
systemd.services.haproxy-config.enable = true;
</syntaxhighlight>
</syntaxhighlight>
[[Category:Applications]]