loft-sh / loft

Namespace & Virtual Cluster Manager for Kubernetes - Lightweight Virtual Clusters, Self-Service Provisioning for Engineers and 70% Cost Savings with Sleep Mode
https://loft.sh/docs/introduction
Other
727 stars 64 forks source link

loft template to terminate port-forwarding after specificed time #71

Open blairham opened 3 years ago

blairham commented 3 years ago

Issue While the dev command is super useful, it falls short when a user has left open a devspace dev as the port forwarding keeps the space active and never lets it sleep or delete.

Expected Adding a template that would put a time limit on port forwarding, so that a space can sleep appropriately and eventually be deleted

FabianKramm commented 3 years ago

@blairham thanks for reporting this! I'm not exactly sure if I understand this correctly, what do you mean by template? Do you want a timeout for the devspace dev command that basically interrupts port-forwarding and sync after a certain time period? Another possibility would be that loft could ignore still open connections for a space and not count these as activity, this could be enabled and disabled via an annotation on the space.

blairham commented 3 years ago

@FabianKramm yes, I'm looking for a way to timeout the dev command, it seems that people just leave that running and don't ever terminate it which leaves that space around forever until I manually terminate it. The latter idea seems like the most ideal option in my opinion.

FabianKramm commented 3 years ago

@blairham I see, yes we'll add an option to ignore still open connections for sleep mode in the next loft relase

blairham commented 3 years ago

@FabianKramm I was thinking about this and it might also be worth considering adding a timeout section in the devspace.yaml dev section. Then we could just set a timeout level there.