-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initialize route backends after module updates #243
Conversation
5b64299
to
8ba1716
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is working, even tho it has some unexpected errors popping out in the UI
In the UI? How do you mean? ngrok dashboard? |
Yep, the ngrok dashboard. Not necessarily something ppl will look at tho 🤔 |
If we get an error that there is no sense in retrying (ie: bad config, real error from ngrok, not just a netwrok flake, etc) you can return a Result object in your reconcile function that specifies not to re-queue it
You could probably create a specific error type https://github.com/ngrok/kubernetes-ingress-controller/blob/main/internal/errors/errors.go and check for that when returning in the reconciler |
@nijikokun 's comment also talked about creating a static response backend to use as the placeholder while updating
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of questions and maybe future scope items
Awesome. I'll go ahead and do this. 👍🏼 |
…error type that does not re-reconcile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks for bearing with me on all my comments!
The commits could probably use some rebasing/rewording to make git history read better, but code-wise, this makes sense.
Yeah, I'm planning to squash them honestly, just because we changed approaches a few times midflight. Agree! |
Resolves #208
What
Applying edge routes' backend is now deferred until after route modules are successfully applied. If route modules fail to apply for any reason, the route's backend remains unset, thus closing off access to the edge from that route.
This approach was inspired by Niji's comment in the parent issue.
How
2a. If route module application was successful, routes are then updated with their specified backend
2b. If unsuccessful,
reconcileRoutes
returns an error and the route remains backend-lessBreaking Changes
Edge routes will no longer be valid if an error occurs while applying route modules.
Validation
Given this sample
manifest.yml
:Expand
Creating a new route
kubectl apply -f manifest.yml
kubectl logs ngrok-ingress-controller-kubernetes-ingress-controller-<HASH> -f
Updating a current route
clientSecret
configuration.clientSecret
, like above.Future Work
ipPolicies
validation so that we can evaluate other module criteria (such as the correctly set secrets) before executing updates.