0

How to do a live update of log rotation policy in a production system such that the policy is propagated to all the nodes (the baremetal machines) in the k8s cluster?

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • Please be more specific - what type of policy are you trying to create? – Gavin Mar 07 '18 at 15:09
  • can you provide more details on the log rotation policy? Log rotation is normally applied to a pod, are you trying to rotate logs of the control plane components? – Gavin Mar 07 '18 at 16:00
  • Yes, control plane components. Currently, the policy is hard-coded unto the image and written during bootstrapping. I need a way to be able to update it without having to bootstrap the entire system. – Owolabi Adekoya Mar 07 '18 at 19:16
  • Have you considered a `DaemonSet`, with a `hostPath` volume mount to enable write access to the Node's filesystem? I've used that to deploy new systemd services onto the Nodes, so it is plausible it would work for your situation – mdaniel Mar 08 '18 at 05:49
  • Which tool do you use to provision your k8s cluster? On my cluster, the control plane components are provisioned via Deployments/ DaemonSets, so theoretically you could spin up a modified version of the control plane with log rotation enabled and eventually get rid of the older control plane. – Gavin Mar 08 '18 at 16:21
  • @MatthewLDaniel yes that actually works. I was actually doing something wrong; I wasn't checking the correct node. It actually worked initially with the Pod initiated. Thanks. Gavin yes, eventually I will be using Deployments/DaemonSets; I was trying to do a POC to see how things would work. Thanks – Owolabi Adekoya Mar 08 '18 at 21:58
  • @OwolabiAdekoya please answer your question with how you resolved the issue. Then accept it. – David Medinets Jul 18 '20 at 14:15

0 Answers0