Skip to content
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

Fluentd stops processing the logs if a pod is restarted #296

Closed
dhineshbabuelango opened this issue Dec 8, 2021 · 9 comments
Closed

Fluentd stops processing the logs if a pod is restarted #296

dhineshbabuelango opened this issue Dec 8, 2021 · 9 comments

Comments

@dhineshbabuelango
Copy link

Hi Team,
We are using fluentd in EKS cluster, we are injesting logs from a file in the container to fluentd through a configmap, using grok parser, while the initial setup working fine everytime when a deployment or pod is restarted, we had to recreate the config map(without any change) as well only then fluentd processing the logs

@Cryptophobia
Copy link
Contributor

This is a known issue with file-mount logs.

See #289

Duplicate of #289

@Cryptophobia
Copy link
Contributor

Duplicate of #289

@Cryptophobia Cryptophobia marked this as a duplicate of #289 Dec 8, 2021
@Cryptophobia
Copy link
Contributor

docker.io/vmware/kube-fluentd-operator:v1.16.2 may fix your problems if you don't run very large clusters with lots of configs.

@dhineshbabuelango
Copy link
Author

Is this issue only with type mounted-file?, if so can I use any other type.
Note: the logs of my container are piped to a different folder like /app/jboss/logs and not the stdout and stderr. So in this case my only option is mounted-file?

@Cryptophobia
Copy link
Contributor

Is this issue only with type mounted-file?, if so can I use any other type.

Yes, it only affects mounted-file types.

We are working on a resolution that may work. Are you able to switch to logging to stdout for the jboss server in the container/pod? If you do that then you will not face this problem when pods restart.

@dhineshbabuelango
Copy link
Author

dhineshbabuelango commented Dec 23, 2021

@Cryptophobia Thanks for the update, we are in process of moving the logs to stdout but since we have some applications already running in prod we are finding for a fix. The mounted-file plugin only supports emptydir volume or we can use a persistant storage.

@dhineshbabuelango
Copy link
Author

@Cryptophobia If I restart teh configmap in few seconds to minutes, will fluentd be able to capture all the logs without any miss?

@Cryptophobia
Copy link
Contributor

@Cryptophobia Thanks for the update, we are in process of moving the logs to stdout but since we have some applications already running in prod we are finding for a fix. The mounted-file plugin only supports emptydir volume or we can use a persistant storage.

@dhineshbabuelango , KFO only supports mounted-files logs as emptyDir types so persistent storage would not work at this time. When KFO makes representation in its memory for each of the pods, it only takes into account volumetypes that are emptyDir types.

@Cryptophobia If I restart teh configmap in few seconds to minutes, will fluentd be able to capture all the logs without any miss?

If you write a hook to reload the configmap to delete and recreate the configmap right away after restarting the pods, it should work. It needs to happen right after the restart of the pods though.

@dhineshbabuelango
Copy link
Author

@Cryptophobia thanks for your response. Will refreshing(delete & recreate) the configmap will lead to fluentd missing any of the logs that was currently reading during the restart ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants