Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for log driver settings and volume bindings #1736

Closed
wants to merge 4 commits into from

Conversation

Fluxxo
Copy link

@Fluxxo Fluxxo commented Sep 23, 2016

This PR adds support for log driver settings passed through the docker run command.

Docker has various log-drivers and coming with that a couple of log options for each drivers.
As of now, nomad would only support syslog writing to a nomad specific location.

To use nomad in an environment with an existing logging infrastructure like awslog or SPLUNK, it is necessary to pass the right combination of settings to the docker run command.

This PR enables to insert a logging options block in the docker driver config in a nomad manifest.
Furthermore, it is now possible to mount host folders into containers and to use data volume container.

It could look like this:

`config {
image = "redis:latest"
port_map {
db = 6379
}

volumes = ["/path/on/host:/path/in/container", "...", "..."]
volumes_from = [
"datastorage"
]

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

Jan-Hendrik Lendholt added 4 commits September 20, 2016 09:41
…u don't want to bake certificates into the container, you can mount them into the directory directly.

Furthermore, I added support for volumes-from.

Currently, there is no support to move the data from one container to another, hence: If a container spawns on another host, it is very likely, that the data will not be found.
Before this commit, if the Logging config did not contain a logging option "syslog-address", it would definitely insert this option.
If then, you decide to take another logdriver than syslog, docker would fail because it received a wrong log option for the selected driver.
Now, nomad will only insert the syslog address in a hard way if there are no logging options at all - this way it keeps the default nomad settings.
@schmichael
Copy link
Member

Thanks for the PR! We on the nomad team wanted to put these settings behind an off-by-default configuration option since they do pose some security issues.

Follow #1767 if you're interested in knowing when this feature lands in master. It will be in the 0.5 release which should be out in the next few weeks.

@schmichael schmichael closed this Sep 28, 2016
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants