external-resizer icon indicating copy to clipboard operation
external-resizer copied to clipboard

[WIP DO NOT MERGE] AIO Refactor Draft

Open ConnorJC3 opened this issue 6 months ago • 4 comments

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind api-change /kind bug /kind cleanup /kind design /kind documentation /kind failing-test /kind feature /kind flake

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


Notes from slack:

The sidecars do a lot of "business logic" initialization in their `main.go`s we need to factor out. This is the primary goal I had with my refactoring. Right now, I put the logic in its own package but thought needed on where it should go long term (try to merge into controller packages? leave in its own package? put it in `cmd`?)

There are some things that the `main.go` does that should be done common across all sidecars, specifically:

* Setting up CLI flags and logging
* Creating Kubernetes client (I originally wanted to just pass the config into the sidecar and have it construct its own clients, but that's not possible because `main.go` needs the client to construct informers and similar)
* CSI metrics manager and CSI translator (need to double check these can be safely shared across sidecars)
* HTTP server for profiling and metrics
* Informer factory(s)
* GRPC connection (annoyingly, the resizer has its own library wrapping this, on my todo list to fix)

ConnorJC3 avatar Aug 07 '24 20:08 ConnorJC3