-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
logging: Expand env vars in logging config
This commit adds a command line flag `--log-config-vars` that is used to specify those environment variables that will be expanded in the logging config file contents. This flag enables operators to indirectly define an allow list of sorts of trusted environment variables. A desired use case of this flag is one where `HOST_IP` is pulled from the running container environment and used to direct logs to a node local instance of FluentBit. In this snippet below, the log.yaml configuration file can be defined with a generic `fluent-server` sink that specifies `${HOST_IP}:5170` as its address. CRDB will then pull the IP from the environment and replace the variable with the IP in the logging configuration. ``` containers: - name: cockroach image: cockroachdb/cockroach args: - --log-config-file log.yaml - --log-config-vars HOST_IP env: - name: HOST_IP valueFrom: fieldRef: fieldPath: status.hostIP ``` Closes #81146. Release note (cli change): The CLI now contains a flag (--log-config-vars) that allows for environment variables to be specified for expansion within the logging configuration file. This change allows for a single logging configuration file to service an array of sinks without further manipulation of the configuration file.
- Loading branch information
1 parent
4689e4c
commit faa10a3
Showing
7 changed files
with
250 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.