diff --git a/helm/oauth2-proxy/Chart.yaml b/helm/oauth2-proxy/Chart.yaml index e3cd76a6..925f1417 100644 --- a/helm/oauth2-proxy/Chart.yaml +++ b/helm/oauth2-proxy/Chart.yaml @@ -1,5 +1,5 @@ name: oauth2-proxy -version: 7.16.0 +version: 7.17.0 apiVersion: v2 appVersion: 7.11.0 home: https://oauth2-proxy.github.io/oauth2-proxy/ @@ -31,8 +31,8 @@ maintainers: kubeVersion: ">=1.16.0-0" annotations: artifacthub.io/changes: | - - kind: changed - description: Updated OAuth2-Proxy image to v7.11.0 + - kind: added + description: Added support for HPA spec.behavior configuration for fine-grained scaling policies links: - name: Github PR - url: https://github.com/oauth2-proxy/manifests/pull/329 + url: https://github.com/oauth2-proxy/manifests/pull/331 diff --git a/helm/oauth2-proxy/README.md b/helm/oauth2-proxy/README.md index e64e1ad4..69b885a4 100644 --- a/helm/oauth2-proxy/README.md +++ b/helm/oauth2-proxy/README.md @@ -120,6 +120,7 @@ The following table lists the configurable parameters of the oauth2-proxy chart | `autoscaling.targetCPUUtilizationPercentage` | Horizontal Pod Autoscaler setting. | `80` | | `autoscaling.targetMemoryUtilizationPercentage` | Horizontal Pod Autoscaler setting. | `` | | `autoscaling.annotations` | Horizontal Pod Autoscaler annotations. | `{}` | +| `autoscaling.behavior` | Configure HPA behavior policies for scaling. See [docs](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#configuring-scaling-behavior) | `{}` | | `alphaConfig.enabled` | Flag to toggle any alpha config-related logic | `false` | | `alphaConfig.annotations` | Configmap annotations | `{}` | | `alphaConfig.serverConfigData` | Arbitrary configuration data to append to the server section | `{}` | diff --git a/helm/oauth2-proxy/templates/hpa.yaml b/helm/oauth2-proxy/templates/hpa.yaml index a6d74617..7fe67e7b 100644 --- a/helm/oauth2-proxy/templates/hpa.yaml +++ b/helm/oauth2-proxy/templates/hpa.yaml @@ -35,4 +35,15 @@ spec: type: Utilization averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} {{- end }} + {{- if .Values.autoscaling.behavior }} + behavior: + {{- with .Values.autoscaling.behavior.scaleDown }} + scaleDown: + {{- toYaml . | nindent 6 }} + {{- end }} + {{- with .Values.autoscaling.behavior.scaleUp }} + scaleUp: + {{- toYaml . | nindent 6 }} + {{- end }} + {{- end }} {{- end }} diff --git a/helm/oauth2-proxy/values.yaml b/helm/oauth2-proxy/values.yaml index 47e4d1bf..dbbf0632 100644 --- a/helm/oauth2-proxy/values.yaml +++ b/helm/oauth2-proxy/values.yaml @@ -319,8 +319,28 @@ autoscaling: minReplicas: 1 maxReplicas: 10 targetCPUUtilizationPercentage: 80 -# targetMemoryUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 annotations: {} + # Configure HPA behavior policies for scaling if needed + # Ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#configuring-scaling-behavior + behavior: {} + # scaleDown: + # stabilizationWindowSeconds: 300 + # policies: + # - type: Percent + # value: 100 + # periodSeconds: 15 + # selectPolicy: Min + # scaleUp: + # stabilizationWindowSeconds: 0 + # policies: + # - type: Percent + # value: 100 + # periodSeconds: 15 + # - type: Pods + # value: 4 + # periodSeconds: 15 + # selectPolicy: Max # Configure Kubernetes security context for pod # Ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/