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
proxy: introduce initial proxy cell #25779
Conversation
/test |
/test -> 🟢 |
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.
reviewed just contributing changes, lgtm
(btw I almost broke the benchmarks in proxy/logger_test.go when I last did something to code in that area, they don't get built by default 😅)
79e2391
to
4f641a0
Compare
rebased to |
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.
Thanks a bunch for starting to tackle this!
daemon/cmd/cells.go
Outdated
@@ -112,6 +113,9 @@ var ( | |||
// daemonCell wraps the legacy daemon initialization and provides Promise[*Daemon]. | |||
daemonCell, | |||
|
|||
// Proxy provides the L7 proxy functionality |
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.
Hm, I wonder if there's a more exact way of explaining what pkg/proxy does? From this comment you'll get the impression that pkg/proxy
does the L7 proxying when in fact it just talks to Envoy. E.g. say here it synchronizes redirected L7 backends to envoy or something along those lines so it's more obvious where this piece fits in and what it ingests.
The way I'm thinking about the one-liner comments in this file is how someone new to this codebase pieces together how everything fits together, so I'd try to find a succinct way of describing what each thing does and how it relates to others. Here for example it'd be quite useful to mention that this cell processes the CiliumEnvoyConfig CRD.
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.
How about this:
Proxy provides the proxy port allocation and related datapath coordination and makes different L7 proxies (Envoy, DNS proxy) usable to CIlium endpoints through a common Proxy 'redirect' abstraction.
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.
@jrajahalme thanks for the proposal. it provides way more context and more or less covers all the aspects of the package.
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.
LGTM ✔️
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.
Original file errors should be passed on rather than simply dropped.
daemon/cmd/cells.go
Outdated
@@ -112,6 +113,9 @@ var ( | |||
// daemonCell wraps the legacy daemon initialization and provides Promise[*Daemon]. | |||
daemonCell, | |||
|
|||
// Proxy provides the L7 proxy functionality |
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.
How about this:
Proxy provides the proxy port allocation and related datapath coordination and makes different L7 proxies (Envoy, DNS proxy) usable to CIlium endpoints through a common Proxy 'redirect' abstraction.
2fab210
to
4047b55
Compare
@jrajahalme thanks for your review. fixed the error propagation and used your proxy cell description! |
4047b55
to
6939977
Compare
rebased to no other changes |
/test |
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.
Looks good, thanks!
This commit introduces the proxy hive cell which provides the Proxy. Starting the envoy xDS- and accesslog server became part of a lifecycle hook. The daemon depends on the Proxy and keeps it as member for the time being. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
This commit moves the endpoint interfaces `EndpointInfoSource` & `EndpointUpdater` from `pkg/proxy/logger` to `pkg/proxy/endpoint` because they aren't related with logging. This is necessary to break some cyclic dependencies. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
This commit removes the global variables IdentityAllocator & EndpointManger from `pkg/proxy/epinfo.go`. Now, they are properly kept as fields. To break cyclic dependencies, the endpointinfo has been moved to `pkg/proxy/logger/endpoint/epinfo.go` and is provided via private constructor. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
This commit introduces the `MonitorAgentLogRecordNotifier` as replacement for letting the Daemon directly implement `LogRecordNotifier`. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
This commit introduces proper shutdown of the envoy xDS- and accesslog servers via lifecycle hooks in the proxy cell. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
This commit introduces proper errorhandling (with propagation) when starting the envoy xDS & accesslog servers. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
6939977
to
8b6c83b
Compare
rebased to |
/test |
This PR introduces an initial version of a proxy hive cell which provides the (L7-)Proxy.
The daemon itself still depends on the Proxy and keeps it as member for the time being (which is necessary to pass it to non-modularized components.
The main changes are the following ones
Further changes are meant to be refactored in separate upcoming PRs to keep the scope of this PR as small as possible.