Skip to content

Save The planet by auto turn off your pods on kubernetes

License

Notifications You must be signed in to change notification settings

AxaFrance/dailyclean

Repository files navigation

DailyClean

workflow Code Smells Docker API Docker JOB

DailyClean

About

Daily clean is all you to turn on or off automatically or manually all your pods your kubernetes namespace. Save the planet with DailyClean. Daily clean only use kubernetes native API.

DailyClean Automation

Getting Started

To test dailyclean on your local machine by using kubernetes with Docker Desktop, please use these commands:

git clone https://github.com/AxaGuilDEv/dailyclean.git
cd dailyclean/demo
kubectl create namespace license-preproduction
kubectl config set-context --current --namespace=license-preproduction
# Create a custom service account
kubectl apply -f dailyclean-serviceaccount.yml
# Install dailyclean for the dailyclean service account
kubectl apply -f deployment-dailyclean.yml
# Install three instances of kubernetes-bootcamp
kubectl apply -f deployment-others.yml
# Install MySql
kubectl apply -f deployment-mysql.yml

Now, open your favorite browser and enter the url of dailyclean-api service : http://localhost:30001

Enjoy dailyclean !!!!

How Does It Work

  • Daily clean use native kubernetes API, it works with any kubernetes projects. DailyClean is a pod that have to be install in your namespace. It create cron job that start or stop your pods.
  • API is in native GraalVM so it is lightweight.
  • User interface is in React/Javascript.

you can use specific labels to configure DailyClean in your Kubernetes scripts:

metadata:
  name: my-api
  labels:
    # if false, dailyclean will not stop this pod for deployment
    axa.com/dailyclean: 'false' 
    # WARNING: default value is true for DEPLOYMENT and false for STATEFULTSET
metadata:
  name: fibonacci1
  labels:
    # if true, dailyclean web UI will consider this pod as a function
    axa.com/function: 'true' 

Contribute

Authors

The awesome team :