Skip to content
Permalink
Browse files

feat: finalize netdata config

  • Loading branch information...
etienne-napoleone committed May 8, 2019
1 parent 6b6bd08 commit db00a71475a209fda1a30aa6422ce4bb39cc3c00
@@ -6,6 +6,10 @@ data "template_file" "master-stream" {
}
}

data "template_file" "master-netdata" {
template = "${file("${path.module}/templates/master_netdata.tmpl")}"
}

data "template_file" "slave-stream" {
template = "${file("${path.module}/templates/slave_stream.tmpl")}"

@@ -15,22 +19,46 @@ data "template_file" "slave-stream" {
}
}

resource "kubernetes_config_map" "master" {
data "template_file" "slave-netdata" {
template = "${file("${path.module}/templates/slave_netdata.tmpl")}"
}

resource "kubernetes_config_map" "master-stream" {
metadata {
name = "master-configmap"
name = "master-stream-configmap"
}

data {
"stream.conf" = "${data.template_file.master-stream.rendered}"
}
}

resource "kubernetes_config_map" "slave" {
resource "kubernetes_config_map" "master-netdata" {
metadata {
name = "master-netdata-configmap"
}

data {
"netdata.conf" = "${data.template_file.master-netdata.rendered}"
}
}

resource "kubernetes_config_map" "slave-stream" {
metadata {
name = "slave-configmap"
name = "slave-stream-configmap"
}

data {
"stream.conf" = "${data.template_file.slave-stream.rendered}"
}
}

resource "kubernetes_config_map" "slave-netdata" {
metadata {
name = "slave-netdata-configmap"
}

data {
"netdata.conf" = "${data.template_file.slave-netdata.rendered}"
}
}
@@ -28,10 +28,16 @@ resource "kubernetes_daemonset" "netdata-slave" {

volume_mount {
mount_path = "/etc/netdata/stream.conf"
name = "slave-conf"
name = "slave-stream-conf"
sub_path = "stream.conf"
}

volume_mount {
mount_path = "/etc/netdata/netdata.conf"
name = "slave-netdata-conf"
sub_path = "netdata.conf"
}

volume_mount {
mount_path = "/host/proc"
name = "proc"
@@ -58,10 +64,18 @@ resource "kubernetes_daemonset" "netdata-slave" {
}

volume {
name = "slave-conf"
name = "slave-stream-conf"

config_map {
name = "slave-stream-configmap"
}
}

volume {
name = "slave-netdata-conf"

config_map {
name = "slave-configmap"
name = "slave-netdata-configmap"
}
}

@@ -30,16 +30,30 @@ resource "kubernetes_deployment" "netdata-master" {

volume_mount {
mount_path = "/etc/netdata/stream.conf"
name = "master-conf"
name = "master-stream-conf"
sub_path = "stream.conf"
}

volume_mount {
mount_path = "/etc/netdata/netdata.conf"
name = "master-netdata-conf"
sub_path = "netdata.conf"
}
}

volume {
name = "master-stream-conf"

config_map {
name = "master-stream-configmap"
}
}

volume {
name = "master-conf"
name = "master-netdata-conf"

config_map {
name = "master-configmap"
name = "master-netdata-configmap"
}
}
}
@@ -0,0 +1,5 @@
[global]
hostname = netdata master
history = 12000
[web]
web server threads = 4
@@ -1,55 +1,8 @@
# [API_KEY] is [YOUR-API-KEY], i.e [11111111-2222-3333-4444-555555555555]
[${api_guid}]
# Default settings for this API key

# You can disable the API key, by setting this to: no
# The default (for unknown API keys) is: no
enabled = yes

# A list of simple patterns matching the IPs of the servers that
# will be pushing metrics using this API key.
# The metrics are received via the API port, so the same IPs
# should also be matched at netdata.conf [web].allow connections from
allow from = *

# The default history in entries, for all hosts using this API key.
# You can also set it per host below.
# If you don't set it here, the history size of the central netdata
# will be used.
default history = 3600

# The default memory mode to be used for all hosts using this API key.
# You can also set it per host below.
# If you don't set it here, the memory mode of netdata.conf will be used.
# Valid modes:
# save save on exit, load on start
# map like swap (continuously syncing to disks - you need SSD)
# ram keep it in RAM, don't touch the disk
# none no database at all (use this on headless proxies)
default memory mode = ram

# Shall we enable health monitoring for the hosts using this API key?
# 3 possible values:
# yes enable alarms
# no do not enable alarms
# auto enable alarms, only when the sending netdata is connected
# You can also set it per host, below.
# The default is taken from [health].enabled of netdata.conf
update every = 10
default history = 86400
health enabled by default = auto

# postpone alarms for a short period after the sender is connected
default postpone alarms on connect seconds = 60

# allow or deny multiple connections for the same host?
# If you are sure all your netdata have their own machine GUID,
# set this to 'allow', since it allows faster reconnects.
# When set to 'deny', new connections for a host will not be
# accepted until an existing connection is cleared.
multiple connections = allow

# need to route metrics differently? set these.
# the defaults are the ones at the [stream] section (above)
#default proxy enabled = yes | no
#default proxy destination = IP:PORT IP:PORT ...
#default proxy api key = API_KEY
#default proxy send charts matching = *
@@ -0,0 +1,5 @@
[global]
update every = 10
memory mode = none
[web]
mode = none
@@ -1,49 +1,10 @@
[stream]
# Enable this on slaves, to have them send metrics.
enabled = yes

# Where is the receiving netdata?
# A space separated list of:
#
# [PROTOCOL:]HOST[%INTERFACE][:PORT]
#
# If many are given, the first available will get the metrics.
#
# PROTOCOL = tcp, udp, or unix (only tcp and unix are supported by masters)
# HOST = an IPv4, IPv6 IP, or a hostname, or a unix domain socket path.
# IPv6 IPs should be given with brackets [ip:address]
# INTERFACE = the network interface to use (only for IPv6)
# PORT = the port number or service name (/etc/services)
#
# This communication is not HTTP (it cannot be proxied by web proxies).
destination = ${master_address}

# The API_KEY to use (as the sender)
api key = ${api_guid}

# The timeout to connect and send metrics
timeout seconds = 60

# If the destination line above does not specify a port, use this
default port = 19999

# filter the charts to be streamed
# netdata SIMPLE PATTERN:
# - space separated list of patterns (use \ to include spaces in patterns)
# - use * as wildcard, any number of times within each pattern
# - prefix a pattern with ! for a negative match (ie not stream the charts it matches)
# - the order of patterns is important (left to right)
# To send all except a few, use: !this !that * (ie append a wildcard pattern)
send charts matching = *

# The buffer to use for sending metrics.
# 1MB is good for 10-20 seconds of data, so increase this if you expect latencies.
# The buffer is flushed on reconnects (this will not prevent gaps at the charts).
buffer size bytes = 1048576

# If the connection fails, or it disconnects,
# retry after that many seconds.
reconnect delay seconds = 5

# Sync the clock of the charts for that many iterations, when starting.
initial clock resync iterations = 60

0 comments on commit db00a71

Please sign in to comment.
You can’t perform that action at this time.