Thanks to visit codestin.com
Credit goes to github.com

Skip to content

bjornrobertsson/pod-monitor-descheduler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pod-monitor-descheduler

POC to show a method to deschedule/terminate a unassigned pod after a pre-defined timeout

To build and deploy this application:

Save/update the Python code, pod_monitor.py, focus on the 'namespace' and 'image' location - this is also where the timeout is configured. FQDN in the Python script and imagePullSecret in the yaml as well.

Then build and push the Docker image

Finally, create the Kubernetes resources:

kubectl apply -f token.yaml # Create a token in the Coder UI with a 'reasonable' lifetime kubectl apply -f pod_monitor.yaml

This solution should:

Find pods in the 'coder' namespace that haven't been assigned to a node If a pod has been without a node for more than 90 seconds, it will:

Try to use the Coder CLI to properly stop the workspace Delete the pod using the Kubernetes API Find and delete the parent deployment

About

POC to show a method to deschedule/terminate a unassigned pod after a pre-defined timeout

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published