Skip to content

Commit

Permalink
feat: add behavior to hpa spec (#670)
Browse files Browse the repository at this point in the history
  • Loading branch information
Demonsthere authored Mar 28, 2024
1 parent c1b7809 commit d6f1a53
Show file tree
Hide file tree
Showing 16 changed files with 43 additions and 3 deletions.
3 changes: 3 additions & 0 deletions hacks/values/hydra.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ deployment:
targetMemory:
type: Utilization
averageUtilization: 80
behavior:
scaleUp:
stabilizationWindowSeconds: 60
strategy:
type: RollingUpdate
rollingUpdate:
Expand Down
3 changes: 3 additions & 0 deletions hacks/values/keto.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ deployment:
targetMemory:
type: Utilization
averageUtilization: 80
behavior:
scaleDown:
stabilizationWindowSeconds: 42
extraLabels:
ory.sh/test: keto
podMetadata:
Expand Down
3 changes: 3 additions & 0 deletions hacks/values/kratos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ autoscaling:
targetMemory:
type: Utilization
averageUtilization: 80
behavior:
scaleDown:
selectPolicy: Disabled

kratos:
automigration:
Expand Down
3 changes: 3 additions & 0 deletions hacks/values/oathkeeper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ deployment:
targetMemory:
type: Utilization
averageUtilization: 80
behavior:
scaleDown:
stabilizationWindowSeconds: 60
strategy:
type: RollingUpdate
rollingUpdate:
Expand Down
3 changes: 2 additions & 1 deletion helm/charts/hydra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ A Helm chart for deploying ORY Hydra in Kubernetes
| deployment.automigration | object | `{"extraEnv":[]}` | Parameters for the automigration initContainer |
| deployment.automigration.extraEnv | list | `[]` | Array of extra envs to be passed to the initContainer. Kubernetes format is expected - name: FOO value: BAR |
| deployment.automountServiceAccountToken | bool | `true` | |
| deployment.autoscaling | object | `{"enabled":false,"maxReplicas":3,"minReplicas":1,"targetCPU":{},"targetMemory":{}}` | Configure HPA |
| deployment.autoscaling | object | `{"behavior":{},"enabled":false,"maxReplicas":3,"minReplicas":1,"targetCPU":{},"targetMemory":{}}` | Configure HPA |
| deployment.autoscaling.behavior | object | `{}` | Set custom behavior https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#configurable-scaling-behavior |
| deployment.customLivenessProbe | object | `{}` | Configure a custom livenessProbe. This overwrites the default object |
| deployment.customReadinessProbe | object | `{}` | Configure a custom readinessProbe. This overwrites the default object |
| deployment.customStartupProbe | object | `{}` | Configure a custom startupProbe. This overwrites the default object |
Expand Down
3 changes: 3 additions & 0 deletions helm/charts/hydra/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ metadata:
labels:
{{- include "hydra.labels" . | nindent 4 }}
spec:
{{- with .Values.deployment.autoscaling.behavior }}
behavior: {{- toYaml . | nindent 4 }}
{{- end }}
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
Expand Down
3 changes: 3 additions & 0 deletions helm/charts/hydra/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,9 @@ deployment:
targetMemory: {}
# type: Utilization
# averageUtilization: 80
# -- Set custom behavior
# https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#configurable-scaling-behavior
behavior: {}

# -- Default probe timers
livenessProbe:
Expand Down
3 changes: 2 additions & 1 deletion helm/charts/keto/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ Access Control Policies as a Server
| deployment.automigration | object | `{"extraEnv":[]}` | Parameters for the automigration initContainer |
| deployment.automigration.extraEnv | list | `[]` | Array of extra envs to be passed to the initContainer. Kubernetes format is expected - name: FOO value: BAR |
| deployment.automountServiceAccountToken | bool | `true` | |
| deployment.autoscaling | object | `{"enabled":false,"maxReplicas":100,"minReplicas":1,"targetCPU":{},"targetMemory":{}}` | Autoscaling for keto deployment |
| deployment.autoscaling | object | `{"behavior":{},"enabled":false,"maxReplicas":100,"minReplicas":1,"targetCPU":{},"targetMemory":{}}` | Autoscaling for keto deployment |
| deployment.autoscaling.behavior | object | `{}` | Set custom behavior https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#configurable-scaling-behavior |
| deployment.customLivenessProbe | object | `{}` | Configure a custom livenessProbe. This overwrites the default object |
| deployment.customReadinessProbe | object | `{}` | Configure a custom readinessProbe. This overwrites the default object |
| deployment.customStartupProbe | object | `{}` | Configure a custom startupProbe. This overwrites the default object |
Expand Down
3 changes: 3 additions & 0 deletions helm/charts/keto/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ metadata:
labels:
{{- include "keto.labels" . | nindent 4 }}
spec:
{{- with $autoscaling.behavior }}
behavior: {{- toYaml . | nindent 4 }}
{{- end }}
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
Expand Down
3 changes: 3 additions & 0 deletions helm/charts/keto/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,9 @@ deployment:
targetMemory: {}
# type: Utilization
# averageUtilization: 80
# -- Set custom behavior
# https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#configurable-scaling-behavior
behavior: {}

nodeSelector: {}

Expand Down
1 change: 1 addition & 0 deletions helm/charts/kratos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ A ORY Kratos Helm chart for Kubernetes

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| autoscaling.behavior | object | `{}` | Set custom behavior https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#configurable-scaling-behavior |
| autoscaling.enabled | bool | `false` | |
| autoscaling.maxReplicas | int | `3` | |
| autoscaling.minReplicas | int | `1` | |
Expand Down
3 changes: 3 additions & 0 deletions helm/charts/kratos/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ metadata:
labels:
{{- include "kratos.labels" . | nindent 4 }}
spec:
{{- with .Values.autoscaling.behavior }}
behavior: {{- toYaml . | nindent 4 }}
{{- end }}
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
Expand Down
3 changes: 3 additions & 0 deletions helm/charts/kratos/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,9 @@ autoscaling:
targetMemory: {}
# type: Utilization
# averageUtilization: 80
# -- Set custom behavior
# https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#configurable-scaling-behavior
behavior: {}

## -- Values for initialization job
job:
Expand Down
3 changes: 2 additions & 1 deletion helm/charts/oathkeeper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ A Helm chart for deploying ORY Oathkeeper in Kubernetes
| demo | bool | `false` | If enabled, a demo deployment with exemplary access rules and JSON Web Key Secrets will be generated. |
| deployment.annotations | object | `{}` | |
| deployment.automountServiceAccountToken | bool | `false` | |
| deployment.autoscaling | object | `{"enabled":false,"maxReplicas":5,"minReplicas":1,"targetCPU":{},"targetMemory":{}}` | Configure horizontal pod autoscaler for deployment |
| deployment.autoscaling | object | `{"behavior":{},"enabled":false,"maxReplicas":5,"minReplicas":1,"targetCPU":{},"targetMemory":{}}` | Configure horizontal pod autoscaler for deployment |
| deployment.autoscaling.behavior | object | `{}` | Set custom behavior https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#configurable-scaling-behavior |
| deployment.customLivenessProbe | object | `{}` | Configure a custom livenessProbe. This overwrites the default object |
| deployment.customReadinessProbe | object | `{}` | Configure a custom readinessProbe. This overwrites the default object |
| deployment.customStartupProbe | object | `{}` | Configure a custom startupProbe. This overwrites the default object |
Expand Down
3 changes: 3 additions & 0 deletions helm/charts/oathkeeper/templates/hpa-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ metadata:
labels:
{{- include "oathkeeper.labels" . | nindent 4 }}
spec:
{{- with .Values.deployment.autoscaling.behavior }}
behavior: {{- toYaml . | nindent 4 }}
{{- end }}
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
Expand Down
3 changes: 3 additions & 0 deletions helm/charts/oathkeeper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@ deployment:
targetMemory: {}
# type: Utilization
# averageUtilization: 80
# -- Set custom behavior
# https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#configurable-scaling-behavior
behavior: {}

# -- Configure node affinity
affinity: {}
Expand Down

0 comments on commit d6f1a53

Please sign in to comment.