-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: metrics aggregate #269
Conversation
zreigz
commented
Sep 17, 2024
•
edited
Loading
edited
- Implement a controller to reconcile a metrics aggregate.
- Create DebounceReconciler as a wrapper that fulfills the controller-runtime interface. It can be use for every controller to delay requests.
25e905e
to
72c4cf1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor comments but makes sense overall
// +kubebuilder:validation:Required | ||
Spec MetricsAggregateSpec `json:"spec"` | ||
|
||
// Status of the IngressReplica |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment for IngressReplica here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
} | ||
|
||
type MetricsAggregateSpec struct { | ||
Nodes int `json:"nodes"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these fields optional? Feels like this should probably be the status struct tbh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've moved to status
fraction = float64(metrics.Spec.MemoryTotalBytes) / float64(metrics.Spec.MemoryAvailableBytes) * 100 | ||
metrics.Spec.MemoryUsedPercentage = int64(fraction) | ||
|
||
return ctrl.Result{}, reterr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't you be requeueing to update on an interval
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Another thing we should do is have the agent insert a default metrics aggregate resource on boot (if it doesn't exist). I'm not sure we'll be able to do it in the helm chart smoothly, because of annoying CRD application/validation stuff, but it would be nice to have zero-config guarantees its there so the console server can query it. Can just name the default one as |
The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, why is the lint action failing though?
Expects to bump the chart version |
it's a chart linter that expects to update the version, we do this only for releases |
@michaeljguarino can we merge this? |