-
Notifications
You must be signed in to change notification settings - Fork 708
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
Report total memory under management for licensing #2277
Report total memory under management for licensing #2277
Conversation
Start a reporter in a goroutine that repeatedly aggregates the total memory of all Elastic components and reports it in the form of a licensing information in a config map.
9f59f72
to
562d835
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.
Looks good overall, few comments.
Issue has been fixed, dismissing this big red X as I am off tomorrow for most of the day.
692cb4e
to
f8b86bf
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Thanks for all the feedbacks. |
|
||
log.V(1).Info("Saving", "license_info", info) | ||
cm := corev1.ConfigMap{ | ||
ObjectMeta: metav1.ObjectMeta{ |
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.
We'd also need to retrieve StatefulSets in the operator namespace so we get its UID, which is not something we currently have RBAC permissions for.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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 after we fix the remaining small nits
Start a reporter in a goroutine that repeatedly (every 2 minutes) aggregates the total memory of all Elastic managed components by the operator and reports it in the form of a licensing information in a config map. Example of the content of the config map: > kubectl -n elastic-system get cm elastic-licensing -o json | jq .data { "eck_license_level": "enterprise", "enterprise_resource_units": "1", "timestamp": "2019-12-20T18:18:31+01:00", "total_managed_memory": "12.88GB" } Notes: - "Enterprise resource units" is an Elastic unit calculated with the total memory under management divided by 64GB. - The ECK license level can be basic, trial-enterprise or entreprise.
Start a reporter in a goroutine that repeatedly (every 2 minutes) aggregates the total memory of
all Elastic managed components by the operator and reports it in the form of a licensing information
in a config map.
I left
cmd/licensing-info/main.go
to show another use: