Skip to content

Instantly share code, notes, and snippets.

@x95castle1
Last active June 12, 2024 23:06
Show Gist options
  • Save x95castle1/cdaf655d1e81c5d56d97c46f3ea10316 to your computer and use it in GitHub Desktop.
Save x95castle1/cdaf655d1e81c5d56d97c46f3ea10316 to your computer and use it in GitHub Desktop.
Overlay to update HPA Autoscaler Defaults for Tekton
#@ load("@ytt:overlay", "overlay")
#@overlay/match by=overlay.subset({"kind": "HorizontalPodAutoscaler", "metadata": {"name": "tekton-pipelines-webhook"}}), expects="1+"
---
spec:
#@overlay/match missing_ok=True
maxReplicas: 20
minReplicas: 10
#@overlay/remove
metrics:
#@overlay/match by=overlay.subset({"kind": "HorizontalPodAutoscaler", "metadata": {"name": "tekton-pipelines-webhook"}}), expects="1+"
---
spec:
#@overlay/match missing_ok=True
metrics:
- resource:
name: cpu
target:
averageUtilization: 90
type: Utilization
type: Resource
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: tekton-pipelines-webhook
namespace: tekton-pipelines
spec:
maxReplicas: 5
metrics:
- resource:
name: cpu
target:
averageUtilization: 100
type: Utilization
type: Resource
minReplicas: 1
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: tekton-pipelines-webhook
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment