consul-k8s
consul-k8s copied to clipboard
Configure Consul agents, Envoy Proxy, and snapshotAgent log levels using global.Loglevel configuration
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
- If you are interested in working on this issue or have submitted a pull request, please leave a comment.
Is your feature request related to a problem? Please describe.
Feature Description
Currently, the global.Loglevel
in the values file only seems to set the log level for Consul-K8S Control-Plane components. This is a feature request to use the same key to set the log level for
- Consul Servers - currently no logLevel value exists and logLevel is passed through extraConfig
- Consul Clients - currently no logLevel value exists and logLevel is passed through extraConfig
- Gateways (Mesh, Ingress, Terminating). As an example the logLevel could be set here for Mesh Gateways link
- Sidecars - currently a logLevel value is set explicitly instead of globally but could default to this global value.
- Snapshot Agent - currently logLevel is set by a Kubernetes secret: https://www.consul.io/docs/k8s/helm#v-client-snapshotagent
Log level for servers, clients, gateways, sidecars, and the snapshotAgent should be set by this global value and also overridable via a Helm value for each of these components to allow for a way to customize log levels. Documentation for the global.logLevel
value should also describe this new behavior.
Log levels for global.logLevel
should only support the following values, otherwise an error must be presented upon helm install
or helm upgrade
: trace, debug, info, warn, and error
Log Level Reference
Consul K8s Control Plane: trace, debug, info, warn, and error (see acl-init) Consul Agent log levels: trace, debug, info, warn, and error (see consul logging) Envoy proxy log levels: trace, debug, info, warn, error, critical, off per "Debugging Envoy"
Use Case(s)
This will be helpful if we want to control the logging level of the entire Consul components with a single config change. For example, before doing an upgrade, we can do a run first by setting global.Loglevel
to debug
and then do the actual upgrade, which will help troubleshoot the issues faster in the event of a failure.
Contributions
Will modify this to also include Envoy log levels as well for associated gateways managed by the Consul K8s Helm chart.