feat: Opt-in to endpoints for Load balancer Services #568
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Overview
ngrok is migrating from Edges to Endpoints. This allows users to opt-in to using endpoints instead of edges for Load Balancer Services by adding the annotation
k8s.ngrok.com/use-endpoints: "true"
(in most cases).Potential Rough Edges (Running List)
A few cases that notable cases where this migration isn't perfect and could use more consideration or changes:
tls://<domain>
do not terminate TLS by default and need to supply aterminate-tls
traffic policy action if they want TLS to be terminated at ngrok.There are a few workarounds for this, but if you are already using modulesets you can create the following moduleset and specify a min version for TLS termination. As part of the transparent migration from modulesets -> trafficpolicy when using endpoints, this will instruct it to terminate TLS. Ex:
Then you just need to make sure to add the the
tls
NgrokModuleSet to the list of modules on a service, like so:How
This change allows users to opt-in to using endpoints instead of edges. There is a slight refactor for the different types of "resolvers" to their own package so that we can use those resolvers in the
util
package without creating circular dependencies.The current design is if the
k8s.ngrok.com/use-endpoints: "true"
annotation is present, it will attempt to transparently convert the modulesets from the modulesets annotation to equivalent traffic policy. If that fails because we don't have support for a given module in traffic policy or the annotation does not exist, it will fall back to using edges for minimal impact.Breaking Changes
No, there should not be any breaking changes. All of this work outside of the refactor is hidden behind an opt-in annotation.