diff --git a/templates/core/core-dpl.yaml b/templates/core/core-dpl.yaml index 4705c5f6e..9b04b42b2 100644 --- a/templates/core/core-dpl.yaml +++ b/templates/core/core-dpl.yaml @@ -8,7 +8,9 @@ metadata: component: core app.kubernetes.io/component: core spec: + {{- if not .Values.core.autoscaling.enabled }} replicas: {{ .Values.core.replicas }} + {{- end }} revisionHistoryLimit: {{ .Values.core.revisionHistoryLimit }} selector: matchLabels: diff --git a/templates/core/core-hpa.yaml b/templates/core/core-hpa.yaml new file mode 100644 index 000000000..af9c9b3f9 --- /dev/null +++ b/templates/core/core-hpa.yaml @@ -0,0 +1,43 @@ +{{- if .Values.core.autoscaling.enabled }} +apiVersion: {{ ternary "autoscaling/v2" "autoscaling/v2beta2" (.Capabilities.APIVersions.Has "autoscaling/v2") }} +kind: HorizontalPodAutoscaler +metadata: + {{- with .Values.core.autoscaling.annotations }} + annotations: {{ toYaml . | nindent 4 }} + {{- end }} + labels: + {{- include "harbor.labels" . | nindent 4 }} + app.kubernetes.io/component: core + name: {{ template "harbor.core" . }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ template "harbor.core" . }} + minReplicas: {{ .Values.core.autoscaling.minReplicas }} + maxReplicas: {{ .Values.core.autoscaling.maxReplicas }} + metrics: + {{- with .Values.core.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ . }} + {{- end }} + {{- with .Values.core.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ . }} + {{- end }} + {{- with .Values.core.autoscalingTemplate }} + {{- toYaml . | nindent 2 }} + {{- end }} + {{- with .Values.core.autoscaling.behavior }} + behavior: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/templates/exporter/exporter-dpl.yaml b/templates/exporter/exporter-dpl.yaml index 32fac20ac..790514fb2 100644 --- a/templates/exporter/exporter-dpl.yaml +++ b/templates/exporter/exporter-dpl.yaml @@ -9,7 +9,9 @@ metadata: component: exporter app.kubernetes.io/component: exporter spec: + {{- if not .Values.exporter.autoscaling.enabled }} replicas: {{ .Values.exporter.replicas }} + {{- end }} revisionHistoryLimit: {{ .Values.exporter.revisionHistoryLimit }} selector: matchLabels: diff --git a/templates/exporter/exporter-hpa.yaml b/templates/exporter/exporter-hpa.yaml new file mode 100644 index 000000000..b999eaf80 --- /dev/null +++ b/templates/exporter/exporter-hpa.yaml @@ -0,0 +1,43 @@ +{{- if .Values.exporter.autoscaling.enabled }} +apiVersion: {{ ternary "autoscaling/v2" "autoscaling/v2beta2" (.Capabilities.APIVersions.Has "autoscaling/v2") }} +kind: HorizontalPodAutoscaler +metadata: + {{- with .Values.exporter.autoscaling.annotations }} + annotations: {{ toYaml . | nindent 4 }} + {{- end }} + labels: + {{- include "harbor.labels" . | nindent 4 }} + app.kubernetes.io/component: exporter + name: {{ template "harbor.exporter" . }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ template "harbor.exporter" . }} + minReplicas: {{ .Values.exporter.autoscaling.minReplicas }} + maxReplicas: {{ .Values.exporter.autoscaling.maxReplicas }} + metrics: + {{- with .Values.exporter.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ . }} + {{- end }} + {{- with .Values.exporter.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ . }} + {{- end }} + {{- with .Values.exporter.autoscalingTemplate }} + {{- toYaml . | nindent 2 }} + {{- end }} + {{- with .Values.exporter.autoscaling.behavior }} + behavior: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/templates/jobservice/jobservice-dpl.yaml b/templates/jobservice/jobservice-dpl.yaml index 3e426694b..d4eca8aa9 100644 --- a/templates/jobservice/jobservice-dpl.yaml +++ b/templates/jobservice/jobservice-dpl.yaml @@ -8,7 +8,9 @@ metadata: component: jobservice app.kubernetes.io/component: jobservice spec: + {{- if not .Values.jobservice.autoscaling.enabled }} replicas: {{ .Values.jobservice.replicas }} + {{- end }} revisionHistoryLimit: {{ .Values.jobservice.revisionHistoryLimit }} strategy: type: {{ .Values.updateStrategy.type }} diff --git a/templates/jobservice/jobservice-hpa.yaml b/templates/jobservice/jobservice-hpa.yaml new file mode 100644 index 000000000..de0567589 --- /dev/null +++ b/templates/jobservice/jobservice-hpa.yaml @@ -0,0 +1,43 @@ +{{- if .Values.jobservice.autoscaling.enabled }} +apiVersion: {{ ternary "autoscaling/v2" "autoscaling/v2beta2" (.Capabilities.APIVersions.Has "autoscaling/v2") }} +kind: HorizontalPodAutoscaler +metadata: + {{- with .Values.jobservice.autoscaling.annotations }} + annotations: {{ toYaml . | nindent 4 }} + {{- end }} + labels: + {{- include "harbor.labels" . | nindent 4 }} + app.kubernetes.io/component: jobservice + name: {{ template "harbor.jobservice" . }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ template "harbor.jobservice" . }} + minReplicas: {{ .Values.jobservice.autoscaling.minReplicas }} + maxReplicas: {{ .Values.jobservice.autoscaling.maxReplicas }} + metrics: + {{- with .Values.jobservice.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ . }} + {{- end }} + {{- with .Values.jobservice.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ . }} + {{- end }} + {{- with .Values.jobservice.autoscalingTemplate }} + {{- toYaml . | nindent 2 }} + {{- end }} + {{- with .Values.jobservice.autoscaling.behavior }} + behavior: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/templates/portal/deployment.yaml b/templates/portal/deployment.yaml index 88bcd4979..5c9ae1463 100644 --- a/templates/portal/deployment.yaml +++ b/templates/portal/deployment.yaml @@ -8,7 +8,9 @@ metadata: component: portal app.kubernetes.io/component: portal spec: + {{- if not .Values.portal.autoscaling.enabled }} replicas: {{ .Values.portal.replicas }} + {{- end }} revisionHistoryLimit: {{ .Values.portal.revisionHistoryLimit }} selector: matchLabels: diff --git a/templates/portal/portal-hpa.yaml b/templates/portal/portal-hpa.yaml new file mode 100644 index 000000000..7c320be80 --- /dev/null +++ b/templates/portal/portal-hpa.yaml @@ -0,0 +1,43 @@ +{{- if .Values.portal.autoscaling.enabled }} +apiVersion: {{ ternary "autoscaling/v2" "autoscaling/v2beta2" (.Capabilities.APIVersions.Has "autoscaling/v2") }} +kind: HorizontalPodAutoscaler +metadata: + {{- with .Values.portal.autoscaling.annotations }} + annotations: {{ toYaml . | nindent 4 }} + {{- end }} + labels: + {{- include "harbor.labels" . | nindent 4 }} + app.kubernetes.io/component: portal + name: {{ template "harbor.portal" . }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ template "harbor.portal" . }} + minReplicas: {{ .Values.portal.autoscaling.minReplicas }} + maxReplicas: {{ .Values.portal.autoscaling.maxReplicas }} + metrics: + {{- with .Values.portal.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ . }} + {{- end }} + {{- with .Values.portal.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ . }} + {{- end }} + {{- with .Values.portal.autoscalingTemplate }} + {{- toYaml . | nindent 2 }} + {{- end }} + {{- with .Values.portal.autoscaling.behavior }} + behavior: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/templates/registry/registry-dpl.yaml b/templates/registry/registry-dpl.yaml index a86e2eee0..c65d088d2 100644 --- a/templates/registry/registry-dpl.yaml +++ b/templates/registry/registry-dpl.yaml @@ -10,7 +10,9 @@ metadata: component: registry app.kubernetes.io/component: registry spec: + {{- if not .Values.registry.autoscaling.enabled }} replicas: {{ .Values.registry.replicas }} + {{- end }} revisionHistoryLimit: {{ .Values.registry.revisionHistoryLimit }} strategy: type: {{ .Values.updateStrategy.type }} diff --git a/templates/registry/registry-hpa.yaml b/templates/registry/registry-hpa.yaml new file mode 100644 index 000000000..c803c08e1 --- /dev/null +++ b/templates/registry/registry-hpa.yaml @@ -0,0 +1,43 @@ +{{- if .Values.registry.autoscaling.enabled }} +apiVersion: {{ ternary "autoscaling/v2" "autoscaling/v2beta2" (.Capabilities.APIVersions.Has "autoscaling/v2") }} +kind: HorizontalPodAutoscaler +metadata: + {{- with .Values.registry.autoscaling.annotations }} + annotations: {{ toYaml . | nindent 4 }} + {{- end }} + labels: + {{- include "harbor.labels" . | nindent 4 }} + app.kubernetes.io/component: registry + name: {{ template "harbor.registry" . }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ template "harbor.registry" . }} + minReplicas: {{ .Values.registry.autoscaling.minReplicas }} + maxReplicas: {{ .Values.registry.autoscaling.maxReplicas }} + metrics: + {{- with .Values.registry.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ . }} + {{- end }} + {{- with .Values.registry.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ . }} + {{- end }} + {{- with .Values.registry.autoscalingTemplate }} + {{- toYaml . | nindent 2 }} + {{- end }} + {{- with .Values.registry.autoscaling.behavior }} + behavior: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/templates/trivy/trivy-hpa.yaml b/templates/trivy/trivy-hpa.yaml new file mode 100644 index 000000000..d773cbaf0 --- /dev/null +++ b/templates/trivy/trivy-hpa.yaml @@ -0,0 +1,43 @@ +{{- if .Values.trivy.autoscaling.enabled }} +apiVersion: {{ ternary "autoscaling/v2" "autoscaling/v2beta2" (.Capabilities.APIVersions.Has "autoscaling/v2") }} +kind: HorizontalPodAutoscaler +metadata: + {{- with .Values.trivy.autoscaling.annotations }} + annotations: {{ toYaml . | nindent 4 }} + {{- end }} + labels: + {{- include "harbor.labels" . | nindent 4 }} + app.kubernetes.io/component: trivy + name: {{ template "harbor.trivy" . }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: StatefulSet + name: {{ template "harbor.trivy" . }} + minReplicas: {{ .Values.trivy.autoscaling.minReplicas }} + maxReplicas: {{ .Values.trivy.autoscaling.maxReplicas }} + metrics: + {{- with .Values.trivy.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ . }} + {{- end }} + {{- with .Values.trivy.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ . }} + {{- end }} + {{- with .Values.trivy.autoscalingTemplate }} + {{- toYaml . | nindent 2 }} + {{- end }} + {{- with .Values.trivy.autoscaling.behavior }} + behavior: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/templates/trivy/trivy-sts.yaml b/templates/trivy/trivy-sts.yaml index 7e34ee9c7..cdacf1215 100644 --- a/templates/trivy/trivy-sts.yaml +++ b/templates/trivy/trivy-sts.yaml @@ -10,7 +10,9 @@ metadata: component: trivy app.kubernetes.io/component: trivy spec: + {{- if not .Values.trivy.autoscaling.enabled }} replicas: {{ .Values.trivy.replicas }} + {{- end }} serviceName: {{ template "harbor.trivy" . }} selector: matchLabels: diff --git a/test/unittest/core_deployment_test.yaml b/test/unittest/core_deployment_test.yaml index da67d3cbf..d766b2aca 100644 --- a/test/unittest/core_deployment_test.yaml +++ b/test/unittest/core_deployment_test.yaml @@ -43,6 +43,28 @@ tests: path: spec.replicas value: 2 + - it: HPADisabledReplicas + set: + core: + replicas: 2 + autoscaling: + enabled: false + template: templates/core/core-dpl.yaml + asserts: + - equal: + path: spec.replicas + value: 2 + + - it: HPAEnabledReplicas + set: + core: + autoscaling: + enabled: true + template: templates/core/core-dpl.yaml + asserts: + - notExists: + path: spec.replicas + - it: ServiceAccounts set: core: diff --git a/test/unittest/core_hpa_test.yaml b/test/unittest/core_hpa_test.yaml new file mode 100644 index 000000000..0bc91d56e --- /dev/null +++ b/test/unittest/core_hpa_test.yaml @@ -0,0 +1,178 @@ +suite: CoreHPA + +tests: + - it: Default + set: + core: + autoscaling: + enabled: true + template: templates/core/core-hpa.yaml + asserts: + - equal: + path: spec.minReplicas + value: 1 + - equal: + path: spec.maxReplicas + value: 11 + - equal: + path: spec.metrics[0].resource.target.averageUtilization + value: 50 + - equal: + path: spec.metrics[1].resource.target.averageUtilization + value: 50 + + - it: HpaAnnotations + set: + core: + autoscaling: + enabled: true + annotations: + test.annotation: test + template: templates/core/core-hpa.yaml + asserts: + - equal: + path: metadata.annotations["test.annotation"] + value: test + + - it: SpecifyReplicas + set: + core: + autoscaling: + enabled: true + minReplicas: 2 + maxReplicas: 10 + template: templates/core/core-hpa.yaml + asserts: + - equal: + path: spec.minReplicas + value: 2 + - equal: + path: spec.maxReplicas + value: 10 + + - it: SpecifyUtilization + set: + core: + autoscaling: + enabled: true + targetMemoryUtilizationPercentage: 70 + targetCPUUtilizationPercentage: 80 + template: templates/core/core-hpa.yaml + asserts: + - equal: + path: spec.metrics[0].resource.target.averageUtilization + value: 70 + - equal: + path: spec.metrics[1].resource.target.averageUtilization + value: 80 + + - it: AutoscalingTemplateSingle + set: + core: + autoscaling: + enabled: true + autoscalingTemplate: + - type: Pods + pods: + metric: + name: test-metric + target: + type: AverageValue + averageValue: 10000m + template: templates/core/core-hpa.yaml + asserts: + - lengthEqual: + path: spec.metrics + count: 3 + - equal: + path: spec.metrics[2].pods.metric.name + value: test-metric + - equal: + path: spec.metrics[2].pods.target.type + value: AverageValue + - equal: + path: spec.metrics[2].pods.target.averageValue + value: 10000m + + - it: AutoscalingTemplateMultiple + set: + core: + autoscaling: + enabled: true + autoscalingTemplate: + - type: Pods + pods: + metric: + name: test-metric + target: + type: AverageValue + averageValue: 10000m + - type: Pods + pods: + metric: + name: test-metric-multiple + target: + type: AverageValue + averageValue: 500m + template: templates/core/core-hpa.yaml + asserts: + - lengthEqual: + path: spec.metrics + count: 4 + - equal: + path: spec.metrics[2].pods.metric.name + value: test-metric + - equal: + path: spec.metrics[2].pods.target.type + value: AverageValue + - equal: + path: spec.metrics[2].pods.target.averageValue + value: 10000m + - equal: + path: spec.metrics[3].pods.metric.name + value: test-metric-multiple + - equal: + path: spec.metrics[3].pods.target.type + value: AverageValue + - equal: + path: spec.metrics[3].pods.target.averageValue + value: 500m + + - it: Behavior + set: + core: + autoscaling: + enabled: true + behavior: + scaleDown: + stabilizationWindowSeconds: 300 + policies: + - type: Pods + value: 1 + periodSeconds: 180 + scaleUp: + stabilizationWindowSeconds: 600 + policies: + - type: Pods + value: 2 + periodSeconds: 60 + template: templates/core/core-hpa.yaml + asserts: + - equal: + path: spec.behavior.scaleDown.stabilizationWindowSeconds + value: 300 + - equal: + path: spec.behavior.scaleDown.policies[0].value + value: 1 + - equal: + path: spec.behavior.scaleDown.policies[0].periodSeconds + value: 180 + - equal: + path: spec.behavior.scaleUp.stabilizationWindowSeconds + value: 600 + - equal: + path: spec.behavior.scaleUp.policies[0].value + value: 2 + - equal: + path: spec.behavior.scaleUp.policies[0].periodSeconds + value: 60 \ No newline at end of file diff --git a/values.yaml b/values.yaml index 98206b0f4..a0e0c736a 100644 --- a/values.yaml +++ b/values.yaml @@ -511,6 +511,38 @@ nginx: ## The priority class to run the pod as priorityClassName: + # Horizontal Pod Autoscaler + autoscaling: + enabled: false + annotations: {} + minReplicas: 1 + maxReplicas: 11 + targetCPUUtilizationPercentage: 50 + targetMemoryUtilizationPercentage: 50 + behavior: {} + # scaleDown: + # stabilizationWindowSeconds: 300 + # policies: + # - type: Pods + # value: 1 + # periodSeconds: 180 + # scaleUp: + # stabilizationWindowSeconds: 300 + # policies: + # - type: Pods + # value: 2 + # periodSeconds: 60 + autoscalingTemplate: [] + # Custom or additional autoscaling metrics + # ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-custom-metrics + # - type: Pods + # pods: + # metric: + # name: nginx_ingress_controller_nginx_process_requests_total + # target: + # type: AverageValue + # averageValue: 10000m + portal: image: repository: goharbor/harbor-portal @@ -551,6 +583,38 @@ portal: # image: busybox # command: [ 'sh', '-c', "sleep 20" ] + # Horizontal Pod Autoscaler + autoscaling: + enabled: false + annotations: {} + minReplicas: 1 + maxReplicas: 11 + targetCPUUtilizationPercentage: 50 + targetMemoryUtilizationPercentage: 50 + behavior: {} + # scaleDown: + # stabilizationWindowSeconds: 300 + # policies: + # - type: Pods + # value: 1 + # periodSeconds: 180 + # scaleUp: + # stabilizationWindowSeconds: 300 + # policies: + # - type: Pods + # value: 2 + # periodSeconds: 60 + autoscalingTemplate: [] + # Custom or additional autoscaling metrics + # ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-custom-metrics + # - type: Pods + # pods: + # metric: + # name: nginx_ingress_controller_nginx_process_requests_total + # target: + # type: AverageValue + # averageValue: 10000m + core: image: repository: goharbor/harbor-core @@ -604,6 +668,37 @@ core: # suggest switch provider to redis if you were ran into the db connections spike around # the scenario of high concurrent pushing to same project, no improvment for other scenes. quotaUpdateProvider: db # Or redis + # Horizontal Pod Autoscaler + autoscaling: + enabled: false + annotations: {} + minReplicas: 1 + maxReplicas: 11 + targetCPUUtilizationPercentage: 50 + targetMemoryUtilizationPercentage: 50 + behavior: {} + # scaleDown: + # stabilizationWindowSeconds: 300 + # policies: + # - type: Pods + # value: 1 + # periodSeconds: 180 + # scaleUp: + # stabilizationWindowSeconds: 300 + # policies: + # - type: Pods + # value: 2 + # periodSeconds: 60 + autoscalingTemplate: [] + # Custom or additional autoscaling metrics + # ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-custom-metrics + # - type: Pods + # pods: + # metric: + # name: nginx_ingress_controller_nginx_process_requests_total + # target: + # type: AverageValue + # averageValue: 10000m # Secret is used when core server communicates with other components. # If a secret key is not specified, Helm will generate one. Alternatively set existingSecret to use an existing secret # Must be a string of 16 chars. @@ -702,6 +797,38 @@ jobservice: # Key within the existing secret for the job service secret existingSecretKey: JOBSERVICE_SECRET + # Horizontal Pod Autoscaler + autoscaling: + enabled: false + annotations: {} + minReplicas: 1 + maxReplicas: 11 + targetCPUUtilizationPercentage: 50 + targetMemoryUtilizationPercentage: 50 + behavior: {} + # scaleDown: + # stabilizationWindowSeconds: 300 + # policies: + # - type: Pods + # value: 1 + # periodSeconds: 180 + # scaleUp: + # stabilizationWindowSeconds: 300 + # policies: + # - type: Pods + # value: 2 + # periodSeconds: 60 + autoscalingTemplate: [] + # Custom or additional autoscaling metrics + # ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-custom-metrics + # - type: Pods + # pods: + # metric: + # name: nginx_ingress_controller_nginx_process_requests_total + # target: + # type: AverageValue + # averageValue: 10000m + registry: registry: image: @@ -789,6 +916,38 @@ registry: interval: 24h dryrun: false + # Horizontal Pod Autoscaler + autoscaling: + enabled: false + annotations: {} + minReplicas: 1 + maxReplicas: 11 + targetCPUUtilizationPercentage: 50 + targetMemoryUtilizationPercentage: 50 + behavior: {} + # scaleDown: + # stabilizationWindowSeconds: 300 + # policies: + # - type: Pods + # value: 1 + # periodSeconds: 180 + # scaleUp: + # stabilizationWindowSeconds: 300 + # policies: + # - type: Pods + # value: 2 + # periodSeconds: 60 + autoscalingTemplate: [] + # Custom or additional autoscaling metrics + # ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-custom-metrics + # - type: Pods + # pods: + # metric: + # name: nginx_ingress_controller_nginx_process_requests_total + # target: + # type: AverageValue + # averageValue: 10000m + trivy: # enabled the flag to enable Trivy scanner enabled: true @@ -882,6 +1041,38 @@ trivy: # The duration to wait for scan completion timeout: 5m0s + # Horizontal Pod Autoscaler + autoscaling: + enabled: false + annotations: {} + minReplicas: 1 + maxReplicas: 11 + targetCPUUtilizationPercentage: 50 + targetMemoryUtilizationPercentage: 50 + behavior: {} + # scaleDown: + # stabilizationWindowSeconds: 300 + # policies: + # - type: Pods + # value: 1 + # periodSeconds: 180 + # scaleUp: + # stabilizationWindowSeconds: 300 + # policies: + # - type: Pods + # value: 2 + # periodSeconds: 60 + autoscalingTemplate: [] + # Custom or additional autoscaling metrics + # ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-custom-metrics + # - type: Pods + # pods: + # metric: + # name: nginx_ingress_controller_nginx_process_requests_total + # target: + # type: AverageValue + # averageValue: 10000m + database: # if external database is used, set "type" to "external" # and fill the connection information in "external" section @@ -1058,3 +1249,35 @@ exporter: # whenUnsatisfiable: DoNotSchedule cacheDuration: 23 cacheCleanInterval: 14400 + + # Horizxonal Pod Autoscaler + autoscaling: + enabled: false + annotations: {} + minReplicas: 1 + maxReplicas: 11 + targetCPUUtilizationPercentage: 50 + targetMemoryUtilizationPercentage: 50 + behavior: {} + # scaleDown: + # stabilizationWindowSeconds: 300 + # policies: + # - type: Pods + # value: 1 + # periodSeconds: 180 + # scaleUp: + # stabilizationWindowSeconds: 300 + # policies: + # - type: Pods + # value: 2 + # periodSeconds: 60 + autoscalingTemplate: [] + # Custom or additional autoscaling metrics + # ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-custom-metrics + # - type: Pods + # pods: + # metric: + # name: nginx_ingress_controller_nginx_process_requests_total + # target: + # type: AverageValue + # averageValue: 10000m