Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tuladhar/k8s-logrotate
Ansible playbook to setup logrotate for on-prem Kubernetes master/worker nodes.
https://github.com/tuladhar/k8s-logrotate
ansible devops hacktoberfest hacktoberfest-accepted playbook
Last synced: 25 days ago
JSON representation
Ansible playbook to setup logrotate for on-prem Kubernetes master/worker nodes.
- Host: GitHub
- URL: https://github.com/tuladhar/k8s-logrotate
- Owner: tuladhar
- License: mit
- Created: 2021-05-21T15:12:40.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-04T08:37:50.000Z (over 2 years ago)
- Last Synced: 2023-05-18T19:34:24.534Z (over 1 year ago)
- Topics: ansible, devops, hacktoberfest, hacktoberfest-accepted, playbook
- Homepage:
- Size: 9.77 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```