Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

Ephemeral Enforcer is here to make sure to clean up all workloads left in your Kubernetes namespaces

License

Notifications You must be signed in to change notification settings

Spazzy757/ephemeral-enforcer

Repository files navigation

Go Report Card PkgGoDev codecov

Kill All The Things

How it works

Ephemeral Enforcer has one job, to destroy. Install it in a cluster and it will clean up resources after a predefined amount of time. This enforces your workloads to be ephemeral.

Why would I do that ?

  • Demo environments
  • End to End testing environment
  • Developer tooling and demos
  • Workloads not defined in code

Getting Started

To deploy to a cluster:

export NAMESPACE=${YOUR NAMESPACE}

kubectl -n $NAMESPACE kubectl apply -k manifests/

Environment

 # Comma seperated list of resources t skip deleteing
 - name: DISSALLOW_LIST
   value: "statefulsets,secrets"
 # Which Namespace To Kill Workloads
 - name: NAMESPACE
   value: example
 # When Should the Enforcer Check
 - name: ENFORCER_SCHEDULE
   value: "*/5 * * * *"
 # How Long Workloads Should Be Allowed to Live For (in minutes)
 - name: WORKLOAD_TTL
   value: "60"

If you would like to ephemeral enforcer to not delete your resource you can label it:

kubectl label deployment my-awesome-deployment ephemeral-enforcer=safe

About

Ephemeral Enforcer is here to make sure to clean up all workloads left in your Kubernetes namespaces

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks