-
Notifications
You must be signed in to change notification settings - Fork 825
performance: use cached kube client for the infra runner #8764
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
Merged
jukie
merged 23 commits into
envoyproxy:main
from
zhaohuabing:kub-infra-provider-cache-client
Apr 25, 2026
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
407b91f
use cached client from the controller manager
zhaohuabing f35fcfb
fix rbac
zhaohuabing 64a8a63
address comments
zhaohuabing a9d7485
inject provider kube client to infra runner
zhaohuabing 9bf921f
add retries for rate limit server
zhaohuabing 6c75c2f
watch only EG owned resources
zhaohuabing af82b3d
add release note
zhaohuabing 35aa504
use context to pass the kube client
zhaohuabing 4fdef72
update release note
zhaohuabing 07dbba3
use config.server to pass the kube client
zhaohuabing 28d5afe
fix lint
zhaohuabing 8435151
address comments
zhaohuabing cbc85ad
update release note
zhaohuabing 54336d4
minor wording
zhaohuabing 55cd336
fix test
zhaohuabing cc3962c
fix test
zhaohuabing 1b75784
wait for the cached client and start ratlimit server first
zhaohuabing fd0aa85
Merge remote-tracking branch 'origin/main' into kub-infra-provider-ca…
zhaohuabing daab861
fix gen
zhaohuabing 6b7f968
remove unnecessary change
zhaohuabing aee73f3
Merge remote-tracking branch 'origin/main' into kub-infra-provider-ca…
zhaohuabing 76a36de
fix rbac
zhaohuabing 321f125
fix gen
zhaohuabing File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,8 @@ import ( | |
| "errors" | ||
| "io" | ||
|
|
||
| "sigs.k8s.io/controller-runtime/pkg/client" | ||
|
|
||
| egv1a1 "github.com/envoyproxy/gateway/api/v1alpha1" | ||
| "github.com/envoyproxy/gateway/api/v1alpha1/validation" | ||
| "github.com/envoyproxy/gateway/internal/logging" | ||
|
|
@@ -39,10 +41,36 @@ type Server struct { | |
| Logger logging.Logger | ||
| // Elected chan is used to signal when an EG instance is elected as leader. | ||
| Elected chan struct{} | ||
| // ProviderReady is closed once the Kubernetes provider cache is synced and the cached client is ready for consumers. | ||
| ProviderReady chan struct{} | ||
| // Stdout is the writer for standard output. | ||
| Stdout io.Writer | ||
| // Stderr is the writer for error output. | ||
| Stderr io.Writer | ||
| // KubernetesClient holds the controller-runtime client created by the Kubernetes provider. | ||
| // This is used by the infrastructure runner to create the envoy proxy and rate limit infra resources. | ||
| KubernetesClient *KubernetesClientHolder | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A |
||
| } | ||
|
|
||
| type KubernetesClientHolder struct { | ||
| client client.Client | ||
| } | ||
|
|
||
| func NewKubernetesClientHolder() *KubernetesClientHolder { | ||
| return &KubernetesClientHolder{} | ||
| } | ||
|
|
||
| func (h *KubernetesClientHolder) Set(cli client.Client) { | ||
| if h != nil { | ||
| h.client = cli | ||
| } | ||
| } | ||
|
|
||
| func (h *KubernetesClientHolder) Get() client.Client { | ||
| if h == nil { | ||
| return nil | ||
| } | ||
| return h.client | ||
| } | ||
|
|
||
| // New returns a Server with default parameters. | ||
|
|
@@ -55,6 +83,8 @@ func New(stdout, stderr io.Writer) (*Server, error) { | |
| Stdout: stdout, | ||
| Stderr: stderr, | ||
| Elected: make(chan struct{}), | ||
| ProviderReady: make(chan struct{}), | ||
| KubernetesClient: NewKubernetesClientHolder(), | ||
| }, nil | ||
| } | ||
|
|
||
|
|
||
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.