-
Notifications
You must be signed in to change notification settings - Fork 0
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: add hpa and async worker to enterprise-catalog. #5
Conversation
7718234
to
f4d98ba
Compare
tutorenterprise/templates/enterprise/apps/enterprise-catalog/settings/partials/common.py
Outdated
Show resolved
Hide resolved
resources: | ||
limits: | ||
cpu: "{{ ENTERPRISE_CATALOG_LIMIT_CPU }}" | ||
memory: "{{ ENTERPRISE_CATALOG_LIMIT_MEMORY }}" | ||
requests: | ||
cpu: "{{ ENTERPRISE_CATALOG_REQUEST_CPU }}" | ||
memory: "{{ ENTERPRISE_CATALOG_REQUEST_MEMORY }}" |
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.
Remove these limits as we don't have any idea of the ideal limits. @Jacatove
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.
@Squirrel18 "Any HPA target can be scaled based on the resource usage of the pods in the scaling target. When defining the pod specification the resource requests like cpu and memory should be specified. This is used to determine the resource utilization and used by the HPA controller to scale the target up or down". Copied from https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-resource-metrics.
So I think it is worth to give some thought about resources:
This is what I have gathered so far. I ran the enterprise-catalog-update-content-job
and this is the result.
Checking the resourses used by the pods, I got this:
enterprise-catalog-64554f5895-8kl52 0m 501Mi
enterprise-catalog-update-content-job-1703786342004-kmzmg 60m 89Mi
jacato:~$ kubectl top pod | grep enterprise
enterprise-catalog-64554f5895-8kl52 0m 501Mi
enterprise-catalog-update-content-job-1703786342004-kmzmg 5m 93Mi
…xt.co> feat: add enterprise-catalog-worker deployment. feat: enable async enterprise-catalog-worker. feat: add hpa to enterprise-catalog. refactor: address suggestions. Update tutorenterprise/templates/enterprise/apps/enterprise-catalog/settings/partials/common.py
Description
Enterprise catalog has been enabled in our platform and there is a need to anticipate future intensive usage of this service, that's why HPA and worker support is being added. Currently, an operation like adding an enterprise customer catalog to a an enterprise customer, takes a considerable amount of time, this is thought as a result of running tasks synchronously.
Changes
Test 1: You can trigger an async task by adding an enterprise customer catalog to a an enterprise customer, the
update_catalog_metadata_task
task is executed by the worker.Test 2:
pip install -e tutor-contrib-enterprise
and verify that the plugin is installedtutor plugins list
tutor config save
tutor local launch
tutor local logs --follow
tutor local do sync-enterprise-catalog-metadata