Skip to content

individual logging options & support for host-fodler volumes

Compare
Choose a tag to compare
@Fluxxo Fluxxo released this 21 Sep 07:03
· 2 commits to v0.4.1-enhancements since this release

This is a minor release featuring two needed features on the docker driver:

Add custom logging options

Adding custom logging options. Nomad currently logs to syslog with a fixed syslog server address. If you want to use SPLUNK REST API oder the SPLUNK Universal log collector, you might need to specify different arguments. This release adds support for this by adding a "logging" atttribute in the job description. Syntax is like:

logging {
type = "syslog" {
syslog-address = "tcp://127.0.0.1:1415"
tag = "your/logging/tag/{{.ImageName}}/{{.Name}}"
format = "rfc3164"
}
}

All properties that are supported by docker may be passed in: https://docs.docker.com/engine/admin/logging/overview/

Adding support to mount host-based volumes and data volume container

Currently, nomad only mounted a custom folder to write its data to. If you needed to mount in a folder from the host, there was no way to do this. A use case is for example to mount in certificates or credentials that you don't want to be baked into a docker image. Hence, you might have the need to mount a folder.

The syntax is like:

volumes = [
"/home/jan/nomad-test:/nomad-test",
"/home/jan/test2:/nomad-test2"
]

volumes_from = [
"datastorage"
]

Please keep in mind: There is no automatic creation mechanism for "volumes-from" - you need to create that container on the machine(s) manually and take care that the containers get provisioned on an adeqaute machine.
I personally disencourage to use this feature, I just built it in for convinience.
Use this feature with caution.