Skip to content

A controller to mange hard and soft TTLs for namespaces.

Notifications You must be signed in to change notification settings

openshift/ci-ns-ttl-controller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ci-ns-ttl-controller

This tool implements a Kubernetes controller that manages hard and soft times-to-live (TTLs) for namespaces in order to ensure that namespaces do not persist in order stop resource leaks from test workloads. TTLs can be configured for a namespace by annotating the namespace either at creation time or at any later point:

TTL Type Annotation Key Annotation Value Description
Hard ci.openshift.io/ttl.hard time.Duration-formatted string The time after namespace creation when the namespace should be reaped.
Soft ci.openshift.io/ttl.soft time.Duration-formatted string The time after Pod termination or last active marker where, if no other Pods are Pending or Running, the namespace should be reaped. The last active marker is optional and stored as a RFC3339-formatted date in the ci.openshift.io/active annotation.

Whichever TTL is reached first will be used by the controller to delete the namespace.

The controller will only consider pods matching the !ci.openshift.io/ttl.ignore selector for soft TTL calculations, allowing non-matching pods to keep running while considering the namespace to be inactive.

Deployment

Deployment of these components requires system:admin level control, as it requires creating wide-reaching ClusterRoles and ClusterRoleBindings. To deploy, run:

make deploy

About

A controller to mange hard and soft TTLs for namespaces.

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published