Skip to content

Clean up circular dependencies around the kubelet's admitHandlers and the container runtime #132298

Open
@natasha41575

Description

@natasha41575

Basically, this TODO:

// TODO: See if we can remove this and just add them in the allocation manager constructor.

The reason that we have AddPodAdmitHandlers as a separate method for the allocation manager as opposed to just passing in the admit handers into the constructor is because of some circular dependencies:

shutdown manager and probe manager

potential resolution: it doesn't look like the shutdown manager uses the probe manager for anything, so that dependency in the shutdown manager can be removed, thus removing the dependency cycle.

shutdown manager and volume manager

  • Construction of the container runtime depends on the allocation manager.
  • One of the allocation manager's handlers depends on the [shutdown manager].
  • The shutdown manager depends on the volume manager.
  • The volume manager depends on the container runtime.

potential resolution: it doesn't look like the volume manager uses the container runtime for anything, so that dependency in the volume manager can likewise be removed, removing the dependency cycle.

eviction manager and image manager

  • Construction of the image manager depends on the container runtime.
  • Construction of the container runtime depends on the allocation manager.
  • One of the [allocation manager's handlers] depends on the eviction manager.
  • The eviction manager depends on the image manager.

potential resolution: ???

This isn't a huge issue, but in general this a symptom of the kubelet code being filled with bloated and circular dependencies. It makes the code hard to work with. There are probably more that I haven't listed here, but didn't fully dive into it.

(Also noting that me saying "x is not used for anything" is just based on a quick search so I could be wrong - a more thorough search is needed.)

/sig node
/kind cleanup
/triage accepted
/priority important-longterm

Metadata

Metadata

Labels

good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.priority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to complete.sig/nodeCategorizes an issue or PR as relevant to SIG Node.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions