Skip to content

Commit cbe5795

Browse files
Merge pull request #331 from younsl/hpa/behavior
feat: Support HPA spec.behavior for fine-grained scaling policies
2 parents cd33585 + 46cdc72 commit cbe5795

File tree

4 files changed

+37
-5
lines changed

4 files changed

+37
-5
lines changed

helm/oauth2-proxy/Chart.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: oauth2-proxy
2-
version: 7.16.0
2+
version: 7.17.0
33
apiVersion: v2
44
appVersion: 7.11.0
55
home: https://oauth2-proxy.github.io/oauth2-proxy/
@@ -31,8 +31,8 @@ maintainers:
3131
kubeVersion: ">=1.16.0-0"
3232
annotations:
3333
artifacthub.io/changes: |
34-
- kind: changed
35-
description: Updated OAuth2-Proxy image to v7.11.0
34+
- kind: added
35+
description: Added support for HPA spec.behavior configuration for fine-grained scaling policies
3636
links:
3737
- name: Github PR
38-
url: https://github.com/oauth2-proxy/manifests/pull/329
38+
url: https://github.com/oauth2-proxy/manifests/pull/331

helm/oauth2-proxy/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ The following table lists the configurable parameters of the oauth2-proxy chart
120120
| `autoscaling.targetCPUUtilizationPercentage` | Horizontal Pod Autoscaler setting. | `80` |
121121
| `autoscaling.targetMemoryUtilizationPercentage` | Horizontal Pod Autoscaler setting. | `` |
122122
| `autoscaling.annotations` | Horizontal Pod Autoscaler annotations. | `{}` |
123+
| `autoscaling.behavior` | Configure HPA behavior policies for scaling. See [docs](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#configuring-scaling-behavior) | `{}` |
123124
| `alphaConfig.enabled` | Flag to toggle any alpha config-related logic | `false` |
124125
| `alphaConfig.annotations` | Configmap annotations | `{}` |
125126
| `alphaConfig.serverConfigData` | Arbitrary configuration data to append to the server section | `{}` |

helm/oauth2-proxy/templates/hpa.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,15 @@ spec:
3535
type: Utilization
3636
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
3737
{{- end }}
38+
{{- if .Values.autoscaling.behavior }}
39+
behavior:
40+
{{- with .Values.autoscaling.behavior.scaleDown }}
41+
scaleDown:
42+
{{- toYaml . | nindent 6 }}
43+
{{- end }}
44+
{{- with .Values.autoscaling.behavior.scaleUp }}
45+
scaleUp:
46+
{{- toYaml . | nindent 6 }}
47+
{{- end }}
48+
{{- end }}
3849
{{- end }}

helm/oauth2-proxy/values.yaml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,28 @@ autoscaling:
319319
minReplicas: 1
320320
maxReplicas: 10
321321
targetCPUUtilizationPercentage: 80
322-
# targetMemoryUtilizationPercentage: 80
322+
# targetMemoryUtilizationPercentage: 80
323323
annotations: {}
324+
# Configure HPA behavior policies for scaling if needed
325+
# Ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#configuring-scaling-behavior
326+
behavior: {}
327+
# scaleDown:
328+
# stabilizationWindowSeconds: 300
329+
# policies:
330+
# - type: Percent
331+
# value: 100
332+
# periodSeconds: 15
333+
# selectPolicy: Min
334+
# scaleUp:
335+
# stabilizationWindowSeconds: 0
336+
# policies:
337+
# - type: Percent
338+
# value: 100
339+
# periodSeconds: 15
340+
# - type: Pods
341+
# value: 4
342+
# periodSeconds: 15
343+
# selectPolicy: Max
324344

325345
# Configure Kubernetes security context for pod
326346
# Ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/

0 commit comments

Comments
 (0)