Skip to content

StevenACoffman/kube-deploy-cleaner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kubernetes Deployment Cleaner

Very simple script to delete all expired deployments after they pass their annotated expiration time.

In our continuous integration (aka c20n) environment, we wish to have the deployments be deleted after about 4 hours. We annotated these ephemeral deployments with a key deploymentExpirationTime that contains a value four hours in the future, like 2018-07-19T16:29:38Z.

Building the Docker image:

    $ make

Deploying:

    $ kubectl apply -f deploy/
There are a few options:
  • --dry-run - Do not actually remove any deployments, only print what would be done

Credit Where Credit is Due

This code was very lightly modified from kube-job-cleaner (aka rip off).

About

Delete annotated Kubernetes deployments after they are expired

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors