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

Update service-deployment HPA metrics (closes #202) #204

Merged
merged 2 commits into from
Oct 28, 2024

Conversation

ianarsenault
Copy link
Contributor

@ianarsenault ianarsenault commented Oct 25, 2024

This PR updates service-deployment helm chart to not be fixed to just CPU based autoscaling.

  • Updated hpa template to allow passing in metrics instead of just average target utilization for CPU
helm template service-deployment \
  --set 'hpa.metrics[0].type=Resource' \
  --set 'hpa.metrics[0].resource.name=memory' \
  --set 'hpa.metrics[0].resource.target.type=Utilization' \
  --set 'hpa.metrics[0].resource.target.averageUtilization=75' \
  --set 'hpa.metrics[1].type=Resource' \
  --set 'hpa.metrics[1].resource.name=cpu' \
  --set 'hpa.metrics[1].resource.target.type=Utilization' \
  --set 'hpa.metrics[1].resource.target.averageUtilization=75'
  
 
---
# Source: service-deployment/templates/hpa.yaml
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: release-name
  labels:
    helm.sh/chart: service-deployment-0.21.0
    app.kubernetes.io/version: "0.21.0"
    app.kubernetes.io/managed-by: Helm
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: release-name
  minReplicas: 1
  maxReplicas: 20
  metrics:
    - resource:
        name: memory
        target:
          averageUtilization: 75
          type: Utilization
      type: Resource
    - resource:
        name: cpu
        target:
          averageUtilization: 75
          type: Utilization
      type: Resource
  behavior:
    {}

jparavisini
jparavisini previously approved these changes Oct 25, 2024
@ianarsenault ianarsenault force-pushed the autoscaling-updates-service-deployment branch from 14aded7 to b6e9a8c Compare October 25, 2024 21:17
@ianarsenault ianarsenault merged commit 4e4520b into main Oct 28, 2024
1 check passed
@ianarsenault ianarsenault deleted the autoscaling-updates-service-deployment branch October 28, 2024 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants