DataDog/kvexpress-cookbook

Name: kvexpress-cookbook

Owner: Datadog, Inc.

Description: This cookbook installs kvexpress and offers an LWRP to use with Chef.

Created: 2016-01-21 04:47:47.0

Updated: 2017-03-31 21:14:35.0

Pushed: 2016-12-05 15:08:09.0

Homepage: https://github.com/DataDog/kvexpress

Size: 23

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

kvexpress Cookbook

Installs kvexpress and provides an LWRP to use it from within Chef.

Requirements

If you're not using Ubuntu - you can download binary releases from Github.

Attributes
ult['kvexpress']['version'] = '1.9-1'
ult['datadog']['url'] = 'https://app.datadoghq.com'

ere to place the JSON watches.
ult['consul']['config_dir'] = '/etc/consul.d'

 you're using Consul ACLs to protect the 'kvexpress/' KV space and kvexpress::server_config:
fault['consul']['acl']['kvexpress'] = 'acl-goes-here'

 you're using the Datadog API to send events and kvexpress::server_config:
fault['datadog']['api_key'] = 'api_key_goes_here'
fault['datadog']['application_key'] = 'app_key_goes_here'

 you're using the Datadog agent:
ult['kvexpress']['dogstatsd'] = false
Default Usage with a Consul watch

Use kvexpress::default to install the binary.

Use the LWRP to get configuration from Consul during a Chef run - here's an example kvexpress resource:

press 'consul_dns_hosts' do
cation '/etc/hosts.consul'
mpress true
y 'hosts'
de '00644'
mmand 'sudo pkill -HUP dnsmasq'
tifies :reload, 'service[consul]', :delayed

During the Chef run, that resource will do the following:

  1. If there's no file at /etc/hosts.consul, it will try to download the key kvexpress/hosts/data and save it. It will fail silently if there's no key there - that's by design.
  2. It will create a Consul watch inside of /etc/consul.d and reload Consul so any updates are automatically replicated.
  3. If it saves a new file, it will send a SIGHUP to dnsmasq to reload it.

The Consul watch will look something like this:


atches": [
{
  "type": "key",
  "key": "/kvexpress/hosts/checksum",
  "handler": "kvexpress out -k hosts -f /etc/hosts.consul -l 10 -c 00644 -e 'sudo pkill -HUP dnsmasq' -z true"
}


If you don't use Chef - you can manually create the JSON needed for the Consul watch - use the above as a template.

Ad-Hoc Usage with Consul exec

Detailed here.

Contributing

We love pull requests from anyone. Details are available here.

Code of Conduct

This project adheres to the Open Code of Conduct. By participating, you are expected to honor this code.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.