Feature: Easy configuration of the agent itself when containerized
Describe what happened:
When using a containerized agent, it's easy to configure other integrations. But it's super cumbersome to configure
- The agent itself (/etc/datadog-agent/datadog.yaml)
- The docker integration (/etc/datadog-agent/conf.d/docker.d/conf.yaml)
Describe what you expected:
I would expect they can be configured similarly as in other integrations - Either via environment variables, or Docker labels.
But there's no environment variables for non-common settings (for me it's secret_backend_command), and for docker integration, the auto discovery integration will be overriden by the default config provided by the agent image.
The other alternative I tried is to mount /etc/datadog-agent as a whole with both datadog.yaml and conf.d/docker.d/conf.yaml in the volume, but then I lose all the default integrations like io, disk, process. And I don't want to pull in all the config files in my codebase. It's also not future proof - What if the default settings of datadog-agent changes/there's new system-level integration.
The only working solution is I have mount 3 volumes - Two for the config files above, and one for the custom secret backend command. It's far from ideal.
Steps to reproduce the issue:
N/A
Additional environment details (Operating System, Cloud provider, etc):
Hey @zen0wu
Thanks for reaching out!
For the secret_backend_command parameter, our config.go file says that you can use an env var: https://github.com/DataDog/datadog-agent/blob/master/pkg/config/config.go#L216
For the core agent (not trace or process), every parameter prefixed by this method: BindEnvAndSetDefault is configurable via an env var with DD_ in front, all caps, and underscores replacing dots.
So, that would be DD_SECRET_BACKEND_COMMAND for your case.
About the docker integration configuration, our init script here: https://github.com/DataDog/datadog-agent/blob/master/Dockerfiles/agent/entrypoint/51-docker.sh#L22 will not replace the yaml file if it already exist.
So, if you mount a file that contains the docker integration configuration here: /etc/datadog-agent/conf.d/docker.d/conf.yaml.example it won't be overwritten.
Let us know how it goes when you try these options out!
Thanks
This issue has been automatically marked as stale because it has not had activity in the past 15 days.
It will be closed in 30 days if no further activity occurs. If this issue is still relevant, adding a comment will keep it open. Also, you can always reopen the issue if you missed the window.
Thank you for your contributions!
Automatically closed due to inactivity.