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

chore(prefect-worker): add CPU/memory-based HPA #338

Merged
merged 3 commits into from
May 31, 2024

Conversation

parkedwards
Copy link
Contributor

resolves #335

---
# Source: prefect-worker/templates/hpa.yaml
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: prefect-worker
  labels:
    app.kubernetes.io/name: prefect-worker
    helm.sh/chart: prefect-worker-0.0.0
    app.kubernetes.io/instance: release-name
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/component: worker
    prefect-version: 2-latest
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: prefect-worker
  minReplicas: 1
  maxReplicas: 1
  metrics:
    - type: Resource
      resource:
        name: memory
        target:
          type: Utilization
          averageUtilization: 80
    - type: Resource
      resource:
        name: cpu
        target:
          type: Utilization
          averageUtilization: 80

@parkedwards parkedwards requested a review from a team as a code owner May 30, 2024 22:47
"type": "boolean",
"title": "Enabled",
"description": "enable autoscaling for the worker",
"form": true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this form key doesn't actually adhere to the JSON schema, so im suspecting it doesnt do anything here. im going to verify and clean this out in a followup PR

Copy link
Contributor

@jamiezieziula jamiezieziula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty

@parkedwards parkedwards merged commit 683145d into main May 31, 2024
16 checks passed
@parkedwards parkedwards deleted the chore/add-worker-hpa branch May 31, 2024 00:15
@jamiezieziula jamiezieziula added the enhancement An improvement of an existing feature label May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prefect Worker should have autoscalling (HPA)
2 participants