-
Notifications
You must be signed in to change notification settings - Fork 81
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
Make pod logs configurable with config map. #1252
Make pod logs configurable with config map. #1252
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution
There are some comment I have added
And also could you please add the doc related to how to change configuration of pac-config-logging
ex: https://github.com/tektoncd/triggers/blob/main/docs/troubleshooting.md#configuring-debug-logging-for-eventlisteners
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@savitaashture is it coherent with operator configuration?
/retest |
Golang test coverage difference reportCoverage increased by Package report
|
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Yes i think its coherent with Operator, Pipeline, Triggers because now with this PR uses config-logging cm for showing logs But i have a question to @AndrienkoAleksandr that once controller starts and if i edit cm |
cc @vdemeester |
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
c98eb95
to
4e40f02
Compare
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
I provided doc with explanation and I attached demo. I think this stuff should work. |
/retest |
you can fix most of those markdownlint error by doing :
(assuming you have markdownlint binary installed https://github.com/DavidAnson/markdownlint) /cc @piyush-garg if you want to add this to the devguide if you do a pr update on this |
## Configuring debug logging | ||
|
||
pipeline-as-code uses ConfigMap named `pac-config-logging` in the same namespace (`pipelines-as-code` by default) with controllers. To get configmap use the command: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"the ConfigMap"
the same namespace "as the controllers" instead of "with controllers"
"To get the ConfigMap use the following command:"
pac-config-logging 4 9m44s | ||
``` | ||
|
||
To retrieve configmap content: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"the content of the ConfigMap"
} | ||
``` | ||
|
||
Controllers log level defined in the `loglevel.*` fields: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The loglevel.*
fields define the log level for the controllers:
``` | ||
|
||
Controllers log level defined in the `loglevel.*` fields: | ||
- loglevel.pipelinesascode - log level for pipelines-as-code-controller component |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"the log level for the ..." - applies to all three lines
- loglevel.pipelines-as-code-webhook - log level for pipelines-as-code-webhook component | ||
- loglevel.pac-watcher - log level for pipelines-as-code-watcher component | ||
|
||
You can change log level from `info` to `debug` or any other supported values. For example, set up log level `debug` for pipelines-as-code-watcher component: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"change the log level"
"For example, select the debug
log level for the...."
``` | ||
|
||
After that coresponding controller should get a new log level value. | ||
If you want to use the same log level for all pipelines-as-code components, then you have |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove "then you have to"
$ kubectl patch configmap pac-config-logging -n pipelines-as-code --type json -p '[{"op": "replace", "path": "/data/loglevel.pac-watcher", "value":"debug"}]' | ||
``` | ||
|
||
After that coresponding controller should get a new log level value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"After this command, the controller gets a new log level value"
$ kubectl patch configmap pac-config-logging -n pipelines-as-code --type json -p '[ {"op": "remove", "path": "/data/loglevel.pac-watcher"}, {"op": "remove", "path": "/data/loglevel.pipelines-as-code-webhook"}, {"op": "remove", "path": "/data/loglevel.pipelinesascode"}]' | ||
``` | ||
|
||
In this case pipelines-as-code components should get common log level from `zap-logger-config` - `level` field from the json. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"In this case, all pipelines-as-code components get a common log level"
|
||
In this case pipelines-as-code components should get common log level from `zap-logger-config` - `level` field from the json. | ||
|
||
List zap supported log level values: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"zap-logger-config
supports the following log levels:"
Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
/retest |
i fixed the markdownliknt for you, we are about to release 0.19 for osp 1.11 i am happy to merge this but we will need a follow up pr addressing @mramendi doc changes to get in for the minor release (we won't merge feature after tomorrow feature freeze) |
Changes
Make pipelines-as-code log level configurable with help of configmap.
Demo
https://youtu.be/pHId9-WT-Ds
Submitter Checklist
make test lint
before submitting a PR (ie: with pre-commit, no need to waste CPU cycle on CI