Skip to content

Conversation

@sabrina-ngrok
Copy link
Contributor

@sabrina-ngrok sabrina-ngrok commented Nov 11, 2025

#266

What

Redeploys or restarts never complete if ngrok sessions are limited to 1

How

Changes made: https://ampcode.com/threads/T-a0987420-692d-47c2-b885-0d2c7456b717

agent/deployment.yaml - Added rolling update strategy with maxSurge: 0 and maxUnavailable: 1 to prevent session doubling during deployments

values.yaml - Added default agent.lifecycle PreStop hook that sleeps for 15 seconds, giving ngrok time to gracefully disconnect

agent/deployment.yaml - Updated lifecycle reference to use agent.lifecycle with fallback to global lifecycle

This ensures old pods disconnect from ngrok before new ones start, preventing session limit issues during redeploys.

Created agent-deployment_test.yaml with tests that verify:

✅ Rolling update strategy has maxSurge: 0 and maxUnavailable: 1
✅ Default lifecycle PreStop hook sleeps for 15 seconds
✅ Global lifecycle value overrides agent.lifecycle when set
✅ Default terminationGracePeriodSeconds is 30
✅ Custom terminationGracePeriodSeconds can be configured
✅ Agent deployment not created when ingress.enabled: false

Breaking Changes

[None that I know of :)]

@github-actions github-actions bot added area/helm-chart Issues dealing with the helm chart size/L Denotes a PR that changes 100-499 lines labels Nov 11, 2025
@codecov
Copy link

codecov bot commented Nov 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.65%. Comparing base (15e015e) to head (e9a0b4b).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #711      +/-   ##
==========================================
- Coverage   48.77%   48.65%   -0.13%     
==========================================
  Files          95       95              
  Lines       10600    10600              
==========================================
- Hits         5170     5157      -13     
- Misses       5071     5077       +6     
- Partials      359      366       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sabrina-ngrok sabrina-ngrok marked this pull request as ready for review November 11, 2025 23:18
@sabrina-ngrok sabrina-ngrok requested a review from a team as a code owner November 11, 2025 23:18
@github-actions github-actions bot added size/M Denotes a PR that changes 30-99 lines and removed size/L Denotes a PR that changes 100-499 lines labels Nov 14, 2025
@github-actions github-actions bot added size/L Denotes a PR that changes 100-499 lines and removed size/M Denotes a PR that changes 30-99 lines labels Nov 25, 2025
@github-actions github-actions bot added size/M Denotes a PR that changes 30-99 lines and removed size/L Denotes a PR that changes 100-499 lines labels Nov 25, 2025
@sabrina-ngrok sabrina-ngrok added this pull request to the merge queue Dec 1, 2025
Merged via the queue into main with commit e8d5d7d Dec 1, 2025
12 checks passed
@sabrina-ngrok sabrina-ngrok deleted the sabrina/redeploys-restarts-fix branch December 1, 2025 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/helm-chart Issues dealing with the helm chart size/M Denotes a PR that changes 30-99 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants