Skip to content
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

[k8sclusterreceiver] Add hierarchical-resource-quota #29555

Closed
hiwayama opened this issue Nov 29, 2023 · 5 comments
Closed

[k8sclusterreceiver] Add hierarchical-resource-quota #29555

hiwayama opened this issue Nov 29, 2023 · 5 comments

Comments

@hiwayama
Copy link
Contributor

Component(s)

receiver/k8scluster

Is your feature request related to a problem? Please describe.

We use hierarchical-namespaces and hierarchical-resource-quota.
https://github.com/kubernetes-sigs/hierarchical-namespaces

I'd like to obtain the information of HierarchicalResourceQuota to observe the aggregated resource limit amount for each parent namespace.

spec: https://github.com/kubernetes-sigs/hierarchical-namespaces/blob/master/api/v1alpha2/hierarchicalresourcequota_types.go#L59-L67

Describe the solution you'd like

While it is possible to perform a similar operation by retrieving and aggregating all the values of ResourceQuota when querying the values collected by k8sreceiver, it would be appreciated if the k8sclusterreceiver could handle HierarchicalResourceQuota in the same way as ResourceQuota, considering the need to be aware of parent-child relationships in the namespace.

Describe alternatives you've considered

No response

Additional context

No response

@hiwayama hiwayama added enhancement New feature or request needs triage New item requiring triage labels Nov 29, 2023
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@TylerHelmuth TylerHelmuth added priority:p2 Medium receiver/k8scluster and removed needs triage New item requiring triage labels Nov 29, 2023
@hiwayama
Copy link
Contributor Author

hiwayama commented Dec 1, 2023

@dmitryax @TylerHelmuth @povilasv

Can you assign me to implement this feature?
I would like to contribute to this project.

@hiwayama
Copy link
Contributor Author

hiwayama commented Dec 1, 2023

Thank you very much.
I started designing it immediately, but I have a question about how to implement it.

The custom controller for HierachilalResourceQuota does not use client-go and there is no Informer.
ref: https://github.com/kubernetes-sigs/hierarchical-namespaces/blob/master/internal/hrq/hrqreconciler.go

I thought about using dynamicinformer, and I'll create new factory to wrap dynamicinformer.DynamicSharedInformerFactory.

type dynamicSharedInformerFactory struct {
	dynamicinformer.DynamicSharedInformerFactory
}

func (df *dynamicSharedInformerFactory) Start(channel <-chan struct{}) {
	df.DynamicSharedInformerFactory.Start(channel)
}

var gvr = schema.GroupVersionResource{Group: "hnc.x-k8s.io", Version: "v1alpha2", Resource: "HierarchicalResourceQuota"}

func (df *dynamicSharedInformerFactory) WaitForCacheSync(channel <-chan struct{}) map[reflect.Type]bool {
	cache := df.DynamicSharedInformerFactory.WaitForCacheSync(channel)
	return map[reflect.Type]bool{
		reflect.TypeOf(&v1alpha2.HierarchicalResourceQuota{}): cache[gvr],
	}
}

Do you have better implementation ideas?

Copy link
Contributor

github-actions bot commented Feb 5, 2024

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Feb 5, 2024
Copy link
Contributor

github-actions bot commented Apr 5, 2024

This issue has been closed as inactive because it has been stale for 120 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants