Skip to content

Use Pod worker pool #696

@AleksandarSavchev

Description

@AleksandarSavchev

What would you like to be added:

Currently, diki rules run independently of other diki rules. This means that rules that require the creation of a pod to run their checks, e.g. checking the file permissions on a node, have to create a new pod for each rule. This can lead to many pods being created and deleted, which is inefficient and can lead to rule failures due to resource constraints.

To address this issue, there can be a pod worker pool that can be used by multiple rules. This worker pool should:

  • Be created lazily, only when a rule that requires it is executed for the first time.
  • Be shared among all rules that require the creation of a pod to run their checks.
  • Use a mechanism to ensure parallel execution of rules that require the pod worker pool, e.g. mutex.
  • Be cleaned up after all rules of the ruleset have been executed.

Note

Currently, rules that create pods have the options to not create pods on all nodes via the nodeGroupByLabels rule options, e.g.

- ruleID: "242394"
args:
nodeGroupByLabels:
- worker.gardener.cloud/pool

This rule options should be taken into account when implementing the pod worker pool, we would want to create the least amount of pods possible for a given diki run.
It might be required a global nodeGroupByLabels option to be made for the rulesets, instead of per rule, to achieve this goal.

Why is this needed:

Reduce load on scanned cluster by creating a minimal amount of required Pods there.

Metadata

Metadata

Labels

kind/enhancementEnhancement, improvement, extensionpriority/2Priority (lower number equals higher priority)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions