问题
I have fluentd configured on kubernetes, with a couple of running pods. I want to change the td_agent.conf file, and add another tag, however, I can't change the conf file inside every pod. How can I manage this? Do I have to change the yaml file of the running pods and re-run them?
回答1:
Do I have to change the yaml file of the running pods and re-run them?
Correct. The problem is that when you change only the config map value it will not trigger your pods to restart, instead, it will update ConfigMap and mounts on-the-fly which is not handled by fluentd.
I assume you are using helm to deploy fluentd. In this case, you need to add a hash annotation to your Deployment/DaemonSet, example: https://github.com/helm/charts/blob/4a4d83f2c68bb07691e9f9df8b5e5a4327c9f6bf/stable/grafana/templates/statefulset.yaml#L27. You do this for every ConfigMap mount you have, and since a change in annotation triggers a rolling update - you receive the update in fluentd. Also, see this related question for more options.
来源:https://stackoverflow.com/questions/64521658/changing-conf-file-in-fluentd