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?
Asked
Active
Viewed 913 times
0
-
How is the config file provided to the container? Is it built in or maybe you are mounting a configmap object to a pod? – Matt Oct 26 '20 at 10:47
-
Well, we changed the yaml file and the helm chart, and re installed it The problem is that we had several replica pods, and we want them all to have the up-to-date td-agent file, and even if they crash and re run, we want the updated agent. – Omer Oct 27 '20 at 09:06
1 Answers
2
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.

Max Lobur
- 5,662
- 22
- 35