Skip to content
Permalink
Browse files

feat: update to working stream.conf

  • Loading branch information...
etienne-napoleone committed May 8, 2019
1 parent da5f0ec commit 9a4d382f3a8f5a3f0478ce919aa5b53abb4cdbce
@@ -11,7 +11,7 @@ data "template_file" "slave-stream" {

vars = {
api_guid = "af3e2c19-dbab-47c5-91fd-fe64f9172b46"
master_address = "${kubernetes_deployment.netdata-master.metadata.0.labels.app}:1999"
master_address = "${kubernetes_deployment.netdata-master.metadata.0.labels.app}"
}
}

@@ -14,8 +14,6 @@ resource "kubernetes_daemonset" "netdata-slave" {
}
}



template {
metadata {
labels {
@@ -29,8 +27,33 @@ resource "kubernetes_daemonset" "netdata-slave" {
name = "netdata-slave"

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

volume_mount {
mount_path = "/host/proc"
name = "proc"
read_only = true
}

volume_mount {
mount_path = "/host/sys"
name = "sys"
read_only = true
}

volume_mount {
mount_path = "/var/run/docker.sock"
name = "docker"
read_only = true
}

security_context {
"capabilities" = {
"add" = ["SYS_PTRACE"]
}
}
}

@@ -41,6 +64,30 @@ resource "kubernetes_daemonset" "netdata-slave" {
name = "slave-configmap"
}
}

volume {
name = "proc"

host_path {
path = "/proc"
}
}

volume {
name = "sys"

host_path {
path = "/sys"
}
}

volume {
name = "docker"

host_path {
path = "/var/run/docker.sock"
}
}
}
}
}
@@ -29,8 +29,33 @@ resource "kubernetes_deployment" "netdata-master" {
name = "netdata-master"

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

volume_mount {
mount_path = "/host/proc"
name = "proc"
read_only = true
}

volume_mount {
mount_path = "/host/sys"
name = "sys"
read_only = true
}

volume_mount {
mount_path = "/var/run/docker.sock"
name = "docker"
read_only = true
}

security_context {
"capabilities" = {
"add" = ["SYS_PTRACE"]
}
}
}

@@ -41,6 +66,30 @@ resource "kubernetes_deployment" "netdata-master" {
name = "master-configmap"
}
}

volume {
name = "proc"

host_path {
path = "/proc"
}
}

volume {
name = "sys"

host_path {
path = "/sys"
}
}

volume {
name = "docker"

host_path {
path = "/var/run/docker.sock"
}
}
}
}
}
@@ -1,84 +1,3 @@
# netdata configuration for aggregating data from remote hosts
#
# API keys authorize a pair of sending-receiving netdata servers.
# Once their communication is authorized, they can exchange metrics for any
# number of hosts.
#
# You can generate API keys, with the linux command: uuidgen


# -----------------------------------------------------------------------------
# 1. ON SLAVE NETDATA - THE ONE THAT WILL BE SENDING METRICS

[stream]
# Enable this on slaves, to have them send metrics.
enabled = no

# 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 =

# The API_KEY to use (as the sender)
api key =

# 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


# -----------------------------------------------------------------------------
# 2. ON MASTER NETDATA - THE ONE THAT WILL BE RECEIVING METRICS

# You can have one API key per slave,
# or the same API key for all slaves.
#
# netdata searches for options in this order:
#
# a) master netdata settings (netdata.conf)
# b) [stream] section (above)
# c) [API_KEY] section (below, settings for the API key)
# d) [MACHINE_GUID] section (below, settings for each machine)
#
# You can combine the above (the more specific setting will be used).

# API key authentication
# If the key is not listed here, it will not be able to push metrics.

# [API_KEY] is [YOUR-API-KEY], i.e [11111111-2222-3333-4444-555555555555]
[${api_guid}]
# Default settings for this API key
@@ -134,58 +53,3 @@
#default proxy destination = IP:PORT IP:PORT ...
#default proxy api key = API_KEY
#default proxy send charts matching = *


# -----------------------------------------------------------------------------
# 3. PER SENDING HOST SETTINGS, ON MASTER NETDATA
# THIS IS OPTIONAL - YOU DON'T HAVE TO CONFIGURE IT

# This section exists to give you finer control of the master settings for each
# slave host, when the same API key is used by many netdata slaves / proxies.
#
# Each netdata has a unique GUID - generated the first time netdata starts.
# You can find it at /var/lib/netdata/registry/netdata.public.unique.id
# (at the slave).
#
# The host sending data will have one. If the host is not ephemeral,
# you can give settings for each sending host here.

[MACHINE_GUID]
# enable this host: yes | no
# When disabled, the master will not receive metrics for this host.
# THIS IS NOT A SECURITY MECHANISM - AN ATTACKER CAN SET ANY OTHER GUID.
# Use only the API key for security.
enabled = no

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

# The number of entries in the database
history = 3600

# The memory mode of the database: save | map | ram | none
memory mode = save

# Health / alarms control: yes | no | auto
health enabled = yes

# postpone alarms when the sender connects
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?
# the defaults are the ones at the [API KEY] section
#proxy enabled = yes | no
#proxy destination = IP:PORT IP:PORT ...
#proxy api key = API_KEY
#proxy send charts matching = *
Oops, something went wrong.

0 comments on commit 9a4d382

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