Skip to content

Reduce CentralCapacityController workque depth by filtering allowed topologies in storage class #1162

@yuxiang-he

Description

@yuxiang-he

Is your feature request related to a problem?/Why is this needed

See onSCAddOrUpdate implementation in https://github.com/kubernetes-csi/external-provisioner/blob/v4.0.0/pkg/capacity/capacity.go#L378-L384

	segments := c.topologyInformer.List()

	c.capacitiesLock.Lock()
	defer c.capacitiesLock.Unlock()
	for _, segment := range segments {
		c.addWorkItem(segment, sc)
	}

Currently the capacity controller creates a workqueue item for every segment x storageClass combination, some of which are impossible.

Describe the solution you'd like in detail

Storage classes can specify allowed topologies https://kubernetes.io/docs/concepts/storage/storage-classes/#allowed-topologies so not all combinations of segment x storageClass are valid here. An example would be certain types of storage (and hence storage class) are only available in selected topology segments.

We can reduce potential workqueue cardinality by filtering out impossible segment x storageClass combinations. This allows quicker CSIStorageCapacity object updates.

Describe alternatives you've considered

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions