Skip to content

Conversation

@alex-bezek
Copy link
Collaborator

closes: #217

What

We noted that a common error case is when a free user tries to setup their first ingress object, if they haven't found out about their 1 free reserved domain, they may try to use their own custom host and it will fail to be created because they can't reserve additional domains and need to use their free one instead.

However, no information is expressed on the ingress object. The operator sees this ingress object and creates a Domain CRD that would have status conditions and events saying Domain "tinyllama-free-account-domain-test.ngrok.app": HTTP 400: Only accounts on paid plans can reserve domains. Your account can't reserve domains. Upgrade to a paid plan at: https://dashboard.ngrok.com/billing/choose-a-plan [ERR_NGROK_401] Operation ID: op_36OOAJkG4M2Iu8OegrXO0FKJ0k3 . But you have to know to look for that CRD or to list all events.

Instead we would like this information to be more discoverable on the ingress object.

How

Ingress doesn't have conditions on its status, so we can only really use events to relay information.

The below approach is 1 idea. This hooks into the managerdriver ControllerEventHandler functionality that watches other resources. When the status of a domain is updated with a new condition, we can turn that into an event we push to the ingress object. The intention is for this to be extensible to other resources like conditions on the Cloud and Agent endpoints as well (the agent endpoints however require a different way to find what ingress/gateway objects spawned them).

Alternative Approaches

This is getting condition updates and pushing them as events. Alternatively, we could try to make the Domain events work as a multi-event emitter. The events about the errors are emitted by our base controller though https://github.com/ngrok/ngrok-operator/blob/main/internal/controller/base_controller.go#L84 so we would need some abstract way to lookup other resources to event to as well.

Looking for some feedback on this approach before i go too deep.

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

codecov bot commented Dec 4, 2025

Codecov Report

❌ Patch coverage is 2.12766% with 46 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.79%. Comparing base (e8d5d7d) to head (7b25bdb).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
pkg/managerdriver/controller-handler.go 0.00% 44 Missing ⚠️
internal/controller/ingress/ingress_controller.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #719      +/-   ##
==========================================
+ Coverage   48.74%   48.79%   +0.04%     
==========================================
  Files          95       95              
  Lines       10600    10637      +37     
==========================================
+ Hits         5167     5190      +23     
- Misses       5074     5087      +13     
- Partials      359      360       +1     

☔ 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.

@alex-bezek
Copy link
Collaborator Author

I have a different approach here that we discussed offline #730

@alex-bezek alex-bezek closed this Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/controller Issues dealing with the controller size/L Denotes a PR that changes 100-499 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Free tier users trying to use a second domain should get a user friendly error

2 participants