gateway
gateway copied to clipboard
feat: add file resource provider for EG standalone mode
What type of PR is this?
What this PR does / why we need it:
This PR implement two component for file resource provider: Notifier and ResourceStore.
- Notifier monitors paths(files or dirs) on host via fsnotify, and send Write/Remove event to ResourceStore
- ResourceStore load and store resources according to the received event
Which issue(s) this PR fixes:
related #1393
There're some TODOs in this PR, tracked by #3213 #3207
As discussed in today's meeting, I prefer to remove the
EnvoyGatewayCustomProviderand add a flatEnvoyGatewayFileProvider(or a better name).
Custom is needed to allow for different resource and infra provider
As discussed in today's meeting, I prefer to remove the
EnvoyGatewayCustomProviderand add a flatEnvoyGatewayFileProvider(or a better name).Custom is needed to allow for different resource and infra provider
Add it later when a use case comes out? The File/Host Provider is not a custom provider, it's a known one.
As discussed in today's meeting, I prefer to remove the
EnvoyGatewayCustomProviderand add a flatEnvoyGatewayFileProvider(or a better name).Custom is needed to allow for different resource and infra provider
Add it later when a use case comes out? The File/Host Provider is not a custom provider, it's a known one.
use case exists today - file resource provider and host infra provider to implement standalone case, running EG in a docker container or bare metal directly w/o any API server
/retest
Do we plan on releasing this in v1.1.0 ?
cc @arkodg
yeah I'm a +1 for this, prioritizing other PRs right now, will get to this one soon
Some tests will be added after the first round of reviews.
will split changes of api/v1alpha1/validation/envoygateway_validate.go into a separate PR, since it's only a refactor and very easily to conflict.
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. Please feel free to give a status update now, ping for review, when it's ready. Thank you for your contributions!
Hi, does it set -c or --config-path to switch to file-mode? how to implement the config file?
Codecov Report
Attention: Patch coverage is 7.87270% with 550 lines in your changes missing coverage. Please review.
Project coverage is 66.54%. Comparing base (
c109131) to head (3c5d0f1). Report is 1 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #3159 +/- ##
==========================================
- Coverage 67.99% 66.54% -1.45%
==========================================
Files 190 195 +5
Lines 23130 23699 +569
==========================================
+ Hits 15727 15771 +44
- Misses 6284 6809 +525
Partials 1119 1119
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
hey @shawnh2 this PR looks good, added some minor comments !
Hi, does it set
-cor--config-pathto switch to file-mode? how to implement the config file?
You can start file-provider mode like envoy-gateway server -c config.yaml, with config.yaml:
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyGateway
gateway:
controllerName: gateway.envoyproxy.io/gatewayclass-controller
provider:
type: Custom
custom:
resource:
type: File
file:
paths: ["test/"]
logging:
level:
default: info
/retest