-
Notifications
You must be signed in to change notification settings - Fork 157
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
Conversation
c3e53e6
to
63f5e16
Compare
93f17f2
to
18f9557
Compare
535245f
to
d72b63f
Compare
_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.
nitpick but ${LOGCOLLECTOR_ENABLED:-}
is the same with just ${LOGCOLLECTOR_ENABLED}
. by default var is empty
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.
tried it without the default and it didn't work, needed ${LOGCOLLECTOR_ENABLED:-}
🤔
if !cr.IsLogCollectorEnabled() { | ||
return nil | ||
} | ||
|
||
if cr.Spec.LogCollector.Configuration == "" { | ||
if err := deleteConfigMapIfExists(ctx, r.client, cr, logcollector.ConfigMapName(cr.Name)); err != nil { | ||
return errors.Wrap(err, "failed to delete log collector config map") | ||
} | ||
return nil | ||
} |
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.
Should we delete configmap if log collector is disabled?
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.
good point, 57a014d
…bled and the config map empty, delete the config map and continue the follow
preparing the helm chart pr as well |
commit: 723c4d4 |
CHANGE DESCRIPTION
Problem:
Currently, logs are available only for the lifecycle of the particular pods. With this PR we are introducing the support for persistent logs, 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-58
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 - directory
/data/db/logs/
. The logs can also be visible on stdout through the-c logs
container.As part of this pr, we moved the required configuration 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. The fluentbit configuration forfluentbit
can also be provided through the cr.yaml optionconfiguration
.Demo:



In terms of documentation, the functionality is similar to this: https://docs.percona.com/percona-operator-for-mysql/pxc/debug-logs.html
Connected with: percona/percona-docker#1182
CHECKLIST
Jira
Needs Doc
) and QA (Needs QA
)?Tests
compare/*-oc.yml
)?Config/Logging/Testability