Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/noahingh/completed-pod-cleaner
The kubernetes controller clean completed pods.
https://github.com/noahingh/completed-pod-cleaner
cleaner kubernetes kubernetes-operator pods
Last synced: about 2 months ago
JSON representation
The kubernetes controller clean completed pods.
- Host: GitHub
- URL: https://github.com/noahingh/completed-pod-cleaner
- Owner: noahingh
- License: mit
- Created: 2019-07-13T14:10:21.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-05T17:15:20.000Z (over 5 years ago)
- Last Synced: 2024-11-17T02:09:48.595Z (3 months ago)
- Topics: cleaner, kubernetes, kubernetes-operator, pods
- Language: Go
- Homepage:
- Size: 51.8 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Kubernetes completed pod cleaner
The controller delete the completed pods which matched with patterns.## Installation
### K8S
`kubectl apply -f ./deploy/kubernetes.yaml`.### Local
```
git clone [email protected]:hanjunlee/completed-pod-cleaner.git
cd ./completed-pod-cleaner
go build -o completed-pod-cleaner ./cmd
```% Note that you can specify the configuration path of kubernetes with `KUBECONFIG` environment. if you don't set `KUBECONFIG`, it will use `~/.kube/config` as the path.
## Features
- Delete pod with pattern.
**You can specify pods with multiple patterns,** the format is `namespace/name`. For example if you want to delete pods only in the namespace `foo` the pattern should be `foo/*`.
- TTL (seconds).
It has TTL, only delete pods which has overed TTL seconds after completed.
- Delete the job together if the pod is owned by the job.
- It works in both **in-side** and **out-side** of cluster.## Command
```bash
-d, -debug
Debug mode.
-dry-run
Dry run mode, it does not delete pods.
-job
Delete the job together if the pod is owned by the job.
-p, -pattern
(list) Match the pattern with the key of pod, the key is "namespace/name",
and if matched the worker delete the completed pod. The pattern support wildcard("*").
-t, -thread
The count of worker, delete pods and jobs (default 1)
-ttl
TTL seconds after the pod completed (default 0).
```## Example
### Pattern
Suppose you want to delete completed pods in namespace `foo` and `bar`, you should run `completed-pod-cleaner -p foo/* -p bar/*`.### Clean owner job
If you want to delete pod and also the job own the pod, you should run `completed-pod -p foo/* -job`