[v16] Kubernetes App Auto Discovery: improve protocol detection#50268
Merged
marcoandredinis merged 1 commit intobranch/v16from Dec 16, 2024
Merged
[v16] Kubernetes App Auto Discovery: improve protocol detection#50268marcoandredinis merged 1 commit intobranch/v16from
marcoandredinis merged 1 commit intobranch/v16from
Conversation
Kubernetes App Auto Discovery iterates over all Services and tries to auto enroll them as Teleport Applications. During this process, it tries to guess the Service's port protocol to ensure we add the application only if it's either an HTTP or HTTPS capable Service. When there's not annotation configuration (which are teleport specific), we try to infer from the Service's ports. When that doesn't work out, the teleport-agent issues an HTTP HEAD request against the port. This way we detect whether the service can answer HTTP or HTTPS. This PR changes the way teleport infers the protocol using the Service's Port. It was checking for HTTPS (checking for port number and port name), then it did a HTTP HEAD request and then it was checking for HTTP (checking port number and port name). This PR changes 4 things: - checks the port, the node port and the target port against well known ports (443, 80, 8080) - checks the name of the port in bother Port.Name and Port.TargetPort - tries to do HTTPS and HTTP checks before trying an HTTP request - decreases the HTTP request timeout from 5s to 500ms With a demo cluster with 2700+ Services, the reconciliation time decreased from 2m to something very close to 0s.
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
tigrato
approved these changes
Dec 16, 2024
zmb3
approved these changes
Dec 16, 2024
Merged
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Backport #50223 to branch/v16
changelog: Improve performance of Kubernetes App Auto Discover