Skip to main content
Version: v4

Configuration

Configuration sources

Settings can be specified in three ways (in order of precedence):

  1. Command line arguments.
  2. Environment variables starting with DKRON_
  3. dkron.yml config file
caution

Dkron sends anonymous usage data to a server with the purpose of elaborating usage statistics, if you want to disable statistics collection, you can disable it in the dkron config file or in the command line using --disable-usage-stats parameter

Config file location

Config file will be loaded from the following paths:

  • /etc/dkron
  • $HOME/.dkron
  • ./config

Config file example

# Dkron example configuration file
# server: false
# bootstrap-expect: 3
# data-dir: dkron.data
# log-level: debug
# tags:
# dc: east
# encrypt: a-valid-key-generated-with-dkron-keygen
# retry-join:
# - 10.0.0.1
# - 10.0.0.2
# - 10.0.0.3
# raft-multiplier: 1
# webhook-url: https://hooks.slack.com/services/XXXXXX/XXXXXXX/XXXXXXXXXXXXXXXXXXXX
# webhook-payload: "payload={\"text\": \"{{.Report}}\", \"channel\": \"#foo\"}"
# webhook-headers: Content-Type:application/x-www-form-urlencoded
# mail-host: email-smtp.eu-west-1.amazonaws.com
# mail-port: 25
# mail-username": mailuser
# mail-password": mailpassword
# mail-from": [email protected]
# mail-subject_prefix: [Dkron]

Important Configuration Parameters

Here's a detailed explanation of the key configuration parameters:

Core Configuration

ParameterDescription
serverWhen set to true, the agent runs in server mode and participates in leader election. Default: false
bootstrap-expectNumber of expected servers in the cluster. When this many servers are available, Dkron will bootstrap the cluster and start a leader election. This helps automate cluster formation.
data-dirDirectory for storing server-specific data including the replicated log. Default: dkron.data
log-levelLog verbosity level: debug, info, warn, error, fatal, panic. Default: info

Networking and Cluster Formation

ParameterDescription
bind-addrAddress to bind for network services. Uses go-sockaddr template format. Default: {{ GetPrivateIP }}:8946
http-addrAddress to bind the UI web server to. Format: :8080
advertise-addrAddress advertised to other nodes. Uses the bind address by default.
advertise-rpc-portRPC port advertised to clients. Uses rpc-port by default.
rpc-portPort used for RPC communication with clients. Default: 6868
joinInitial agent to join with. Can be specified multiple times.
retry-joinAddress of agent to join with retries. Can be specified multiple times.
retry-intervalTime to wait between join attempts. Default: 30s
retry-maxMaximum number of join attempts. 0 means retry indefinitely.
encryptKey for encrypting network traffic. Must be a base64-encoded 16-byte key generated by dkron keygen

Node Configuration

ParameterDescription
node-nameName of this node. Must be unique in the cluster. Default: system hostname
datacenterData center of the local agent. All members of a datacenter should share a LAN connection. Default: dc1
regionRegion the agent belongs to. A region typically maps to a geographic region. Default: global
tagAttach key/value tag pairs to the node. Format: key=value. Can be specified multiple times.

Performance and Scaling

ParameterDescription
raft-multiplierInteger multiplier for Raft timing parameters. Lower values increase sensitivity to failures but require more resources. 1 is high-performance, 10 is max. Default: 1
profileControls timing profiles. Options: lan, wan, etc. Default: lan
serf-reconnect-timeoutTime to attempt reconnection to failed nodes before removing them. Default: 24h

Notification Configuration

ParameterDescription
webhook-endpointEndpoint URL to call for webhook notifications.
webhook-payloadBody of the POST request to send when calling the webhook.
webhook-headersHeaders to use when calling the webhook URL. Can be specified multiple times.
mail-hostMail server hostname for sending notifications.
mail-portMail server port.
mail-usernameUsername for mail server authentication.
mail-passwordPassword for mail server authentication.
mail-fromFrom email address to use in notifications.
mail-subject-prefixPrefix for the email subject line. Default: [Dkron]

Metrics Configuration

ParameterDescription
statsd-addrAddress of a statsd server for metrics collection.
dog-statsd-addrAddress of a DataDog statsd agent.
dog-statsd-tagsTags to include with DataDog metrics. Format: key:value
enable-prometheusWhen true, enables serving Prometheus metrics at the /metrics endpoint.

Environment Variables

All configuration options can also be specified as environment variables by:

  1. Converting to uppercase
  2. Replacing dashes with underscores
  3. Prefixing with DKRON_

Example: server: true becomes DKRON_SERVER=true

SEE ALSO