Skip to content

Commit

Permalink
feat(hpa): add support for custom annotations on hpa (#1239)
Browse files Browse the repository at this point in the history
* feat(hpa): add support for custom annotations on hpa
  • Loading branch information
GyunCho authored Jan 27, 2025
1 parent 60f7195 commit 36a457c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions charts/kong/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,7 @@ On the Gateway release side, set either `admin.tls.client.secretName` to the nam
| autoscaling.enabled | Set this to `true` to enable autoscaling | `false` |
| autoscaling.minReplicas | Set minimum number of replicas | `2` |
| autoscaling.maxReplicas | Set maximum number of replicas | `5` |
| autoscaling.annotations | Annotations for autoscaling | {} |
| autoscaling.behavior | Sets the [behavior for scaling up and down](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#configurable-scaling-behavior) | `{}` |
| autoscaling.targetCPUUtilizationPercentage | Target Percentage for when autoscaling takes affect. Only used if cluster does not support `autoscaling/v2` or `autoscaling/v2beta2` | `80` |
| autoscaling.metrics | metrics used for autoscaling for clusters that supports `autoscaling/v2` or `autoscaling/v2beta2` | See [values.yaml](values.yaml) |
Expand Down
6 changes: 6 additions & 0 deletions charts/kong/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ metadata:
namespace: {{ template "kong.namespace" . }}
labels:
{{- include "kong.metaLabels" . | nindent 4 }}
{{- if .Values.autoscaling.annotations }}
annotations:
{{- range $key, $value := .Values.autoscaling.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
scaleTargetRef:
apiVersion: apps/v1
Expand Down
1 change: 1 addition & 0 deletions charts/kong/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,7 @@ autoscaling:
enabled: false
minReplicas: 2
maxReplicas: 5
annotations: {}
behavior: {}
## targetCPUUtilizationPercentage only used if the cluster doesn't support autoscaling/v2 or autoscaling/v2beta
targetCPUUtilizationPercentage:
Expand Down

0 comments on commit 36a457c

Please sign in to comment.