Skip to content

Ansible playbook to setup logrotate for on-prem Kubernetes master/worker nodes.

License

Notifications You must be signed in to change notification settings

tuladhar/k8s-logrotate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

k8s-logrotate

An ansible playbook to setup periodic logrotate for your on-prem Kubernetes master/worker nodes to cleanup the container and pods logs to free up the disk space.

Quickstart

Step 1. Create hosts inventory with your K8s nodes

File: hosts.ini

[k8s-nodes]
k8s-worker-1 10.0.0.1
k8s-worker-2 10.0.0.2
k8s-worker-2 10.0.1.3

Step 2. Run the ansible playbook

$ ansible-playbook -i hosts.ini k8s-logrotate.yaml

Step 3. Verify the logrotate files

$ cd /etc/logrotate.d
$ ls -lh
-rw-r--r--  1 root root  192 May 21 14:51 allcontainerlogs
-rw-r--r--  1 root root  186 May 21 14:51 allpodlogs

About

Ansible playbook to setup logrotate for on-prem Kubernetes master/worker nodes.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published