Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/germainlefebvre4/ns-killer
NS Killer is a Kubernetes project to kill all namespaces living over X times. Quite useful when auto-generating development environments on the fly and giving them a lifecycle out-of-the-box from Kubernetes or even Helm.
https://github.com/germainlefebvre4/ns-killer
configmap delete docker dockerhub exclude hacktoberfest helm include kubernetes lifecycle namespace namespaces-living ns-killer python
Last synced: 20 days ago
JSON representation
NS Killer is a Kubernetes project to kill all namespaces living over X times. Quite useful when auto-generating development environments on the fly and giving them a lifecycle out-of-the-box from Kubernetes or even Helm.
- Host: GitHub
- URL: https://github.com/germainlefebvre4/ns-killer
- Owner: germainlefebvre4
- License: apache-2.0
- Created: 2019-12-17T14:19:05.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T11:41:58.000Z (almost 2 years ago)
- Last Synced: 2024-10-10T20:52:03.997Z (about 1 month ago)
- Topics: configmap, delete, docker, dockerhub, exclude, hacktoberfest, helm, include, kubernetes, lifecycle, namespace, namespaces-living, ns-killer, python
- Language: Python
- Homepage:
- Size: 93.8 KB
- Stars: 20
- Watchers: 2
- Forks: 4
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# NS Killer
## What is NS Killer?
A Kubernetes project to kill all namespace living over X times. Quite useful when auto-generated development environments on the fly and give them a lifecycle out-of-the-box from Kubernetes or even Helm.## Getting started
### Docker
```bash
docker run -ti -d --name=ns-killer germainlefebvre4/ns-killer
```Docker image is avaiblable on [Docker Hub](https://hub.docker.com/r/germainlefebvre4/ns-killer).
### Kubernetes
```bash
kubectl apply -f kubernetes/CronJob
```## Requirements
Python version needs to be:
* `3.7`
* `3.8`Python versions `3.6` and under are not supported because of interpretation of datetime library.
## Configuration
The container has no parameters. Configuration is provided by a file at `/etc/config/ns-killer`.Configuration file is structured as following:
| Attribute | Description | Values | Default | Implemented? |
|---|---|---|---|---|
| config.dryrun | Enable the dryrun mode | (string) `enabled` | False | Yes |
| config.retention.kind | Time unit for the frequency loop | (string) `minutes`, `hours`, `days`, `weeks`, `months` | - | Yes |
| config.retention.time | Time data for the frequency loop | (integer) | - | Yes |
| config.namespace.exclude | List of namespaces to keep | list of (string) | - | Yes |
| config.namespace.only | List of namespaces to delete. This parameter make the exclude list evicted. | list of (string) | - | Yes |### Example
```yaml
config:
dryrun: enabled
retention:
kind: hours
time: 2
namespace:
exclude:
- ns-killer
- kube-system
- kube-public
- kube-node-lease
- default
- ingress-nginx
- cert-manager
- gitlab-managed-apps
- cattle-system
- monitoring
- prometheus
- jenkins
- mongodb
- rabbitmq-ha
- wordpress
- gcr-cleanup
only: []
```## Where to use this image
Let's run this image in a Kubernetes cluster.Kubernetes manifest are present in directory [kubernetes/](https://github.com/germainlefebvre4/ns-killer/tree/master/kuberneteskubernetes).