Random bash/python utility/hacks I made for various daily tasks.
Remove server-side generated Kubernetes fields from manifests yaml file. Require yq.
Usage:
./k8s-manifests-cleaner.sh /path/to/parent/dir
For those who have this itch when they see a yaml file without "---" header. Require yq.
Usage:
./k8s-yaml-mark-adder.sh /path/to/parent/dir
Generate separate kustomize files based on joined YAML files/templated Helm charts. For usage, check the repo.
Clean up logs older than certain days.
Usage:
Since this is mostly used by cron, the directory list and retention days is hardcoded into the script. Don't forget to modify as you need.
./log-cleaner.sh