-
Notifications
You must be signed in to change notification settings - Fork 151
K8SPSMDB-297 support persistent logs #1936
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
base: main
Are you sure you want to change the base?
Conversation
c3e53e6
to
63f5e16
Compare
93f17f2
to
18f9557
Compare
535245f
to
d72b63f
Compare
11516e8
to
1ade2b4
Compare
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.
do we need this? if yes, we need to fix the typo in the file name
@@ -743,3 +743,10 @@ spec: | |||
# storageName: s3-us-west | |||
# compressionType: gzip | |||
# compressionLevel: 6 | |||
logcollector: | |||
enabled: true | |||
image: perconalab/percona-xtradb-cluster-operator:main-logcollector |
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.
we need to fix this image, is this temporary?
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.
Until the new images for Fluentbit are ready, I think we should keep this as is. We can change it with a new PR once these new images are ready.
fluentbit_opt+='-c /opt/percona/logcollector/fluentbit/fluentbit.conf' | ||
fi | ||
|
||
exec "$@" $fluentbit_opt |
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.
[shellcheck (suggestion)] reported by reviewdog 🐶
exec "$@" $fluentbit_opt | |
exec "$@" "$fluentbit_opt" |
@@ -480,6 +480,11 @@ if [[ $originalArgOne == mongo* ]]; then | |||
_mongod_hack_rename_arg_save_val --sslDisabledProtocols --tlsDisabledProtocols "${mongodHackedArgs[@]}" | |||
fi | |||
|
|||
if [[ $originalArgOne == "mongod" && "${LOGCOLLECTOR_ENABLED:-}" == "true" ]]; then |
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.
[shfmt] reported by reviewdog 🐶
if [[ $originalArgOne == "mongod" && "${LOGCOLLECTOR_ENABLED:-}" == "true" ]]; then | |
if [[ $originalArgOne == "mongod" && ${LOGCOLLECTOR_ENABLED:-} == "true" ]]; then |
CHANGE DESCRIPTION
Problem:
Logs are available only for the lifecycle of the particular pods. With this PR we are introducing the support for persistent logs in PVC (separate from the PVC used for actual mongo data), focusing for now only on the
mongod
logs.Cause:
Short explanation of the root cause of the issue if applicable.
Solution:
Image:
perconalab/percona-server-mongodb-operator:K8SPSMDB-297-22
The solution utilises FluentBit to manage the log pipeline, appending the appropriate metadata and storing the logs in a single file in a log-specific PVC for each pod. The logs can also be visible on stdout.
As part of this pr, we moved the required files for fluentbit from here: https://github.com/percona/percona-docker/tree/main/fluentbit to this repo and we mount them to the
logs
andlogrotation
containers.In terms of documentation, the functionality is similar to this: https://docs.percona.com/percona-operator-for-mysql/pxc/debug-logs.html
CHECKLIST
Jira
Needs Doc
) and QA (Needs QA
)?Tests
compare/*-oc.yml
)?Config/Logging/Testability