diff --git a/charts/alfresco-transform-service/Chart.yaml b/charts/alfresco-transform-service/Chart.yaml index 2d6962a6..29236bca 100644 --- a/charts/alfresco-transform-service/Chart.yaml +++ b/charts/alfresco-transform-service/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: alfresco-transform-service description: A Helm chart for deploying Alfresco Transform Services type: application -version: 1.2.0 +version: 1.3.0-alpha.0 appVersion: 4.1.0 dependencies: - name: alfresco-common diff --git a/charts/alfresco-transform-service/README.md b/charts/alfresco-transform-service/README.md index 5a7044b2..ecf9bd6b 100644 --- a/charts/alfresco-transform-service/README.md +++ b/charts/alfresco-transform-service/README.md @@ -1,6 +1,6 @@ # alfresco-transform-service -![Version: 1.2.0](https://img.shields.io/badge/Version-1.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 4.1.0](https://img.shields.io/badge/AppVersion-4.1.0-informational?style=flat-square) +![Version: 1.3.0-alpha.0](https://img.shields.io/badge/Version-1.3.0--alpha.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 4.1.0](https://img.shields.io/badge/AppVersion-4.1.0-informational?style=flat-square) A Helm chart for deploying Alfresco Transform Services @@ -66,6 +66,14 @@ Checkout [alfresco-content-services chart's doc](https://github.com/Alfresco/acs | global.strategy.rollingUpdate.maxSurge | int | `1` | | | global.strategy.rollingUpdate.maxUnavailable | int | `0` | | | imagemagick.affinity | string | `"podAntiAffinity:\n preferredDuringSchedulingIgnoredDuringExecution:\n - weight: 10\n podAffinityTerm:\n labelSelector:\n matchExpressions:\n - key: app\n operator: In\n values:\n - {{ template \"alfresco-transform-service.imagemagick.name\" . }}\n topologyKey: topology.kubernetes.io/zone\n - weight: 5\n podAffinityTerm:\n labelSelector:\n matchExpressions:\n - key: app\n operator: In\n values:\n - {{ template \"alfresco-transform-service.imagemagick.name\" . }}\n topologyKey: app.kubernetes.io/name"` | Pod affinity, passed thru tpl function | +| imagemagick.autoscaling.behavior.scaleDown.policies | list | `[{"periodSeconds":60,"type":"Pods","value":1}]` | list of available policies for scaling down scale down either by one pod or by destroying 25% of the pods (whichever is smaller) | +| imagemagick.autoscaling.behavior.scaleDown.stabilizationWindowSeconds | int | `60` | | +| imagemagick.autoscaling.behavior.scaleUp.policies | list | `[{"periodSeconds":60,"type":"Percent","value":50},{"periodSeconds":60,"type":"Pods","value":2}]` | list of available policies for scaling up scale up either by one pod or by adding 50% more pods (whichever is bigger) | +| imagemagick.autoscaling.behavior.scaleUp.stabilizationWindowSeconds | int | `30` | | +| imagemagick.autoscaling.enabled | bool | `false` | Toggle imagemagick autoscaling | +| imagemagick.autoscaling.maxReplicas | int | `3` | maximum number of replicas to spin up within the replicaset | +| imagemagick.autoscaling.metrics | list | `[{"resource":{"name":"cpu","target":{"averageUtilization":75,"type":"Utilization"}},"type":"Resource"}]` | a list of resource the HPA controller should monitor For more details check https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-resource-metrics | +| imagemagick.autoscaling.minReplicas | int | `1` | minimum number of replicas to spin up within the replicaset | | imagemagick.enabled | bool | `true` | | | imagemagick.environment.JAVA_OPTS | string | `"-XX:MinRAMPercentage=50 -XX:MaxRAMPercentage=80"` | | | imagemagick.image.internalPort | int | `8090` | | @@ -87,7 +95,7 @@ Checkout [alfresco-content-services chart's doc](https://github.com/Alfresco/acs | imagemagick.podSecurityContext.runAsUser | int | `33002` | | | imagemagick.readinessProbe.initialDelaySeconds | int | `20` | | | imagemagick.readinessProbe.path | string | `"/ready"` | | -| imagemagick.readinessProbe.periodSeconds | int | `60` | | +| imagemagick.readinessProbe.periodSeconds | int | `30` | | | imagemagick.readinessProbe.timeoutSeconds | int | `10` | | | imagemagick.replicaCount | int | `2` | | | imagemagick.resources.limits.cpu | string | `"4"` | | @@ -101,6 +109,14 @@ Checkout [alfresco-content-services chart's doc](https://github.com/Alfresco/acs | imagemagick.volumeMounts | list | `[]` | | | imagemagick.volumes | list | `[]` | | | libreoffice.affinity | string | `"podAntiAffinity:\n preferredDuringSchedulingIgnoredDuringExecution:\n - weight: 10\n podAffinityTerm:\n labelSelector:\n matchExpressions:\n - key: app\n operator: In\n values:\n - {{ template \"alfresco-transform-service.libreoffice.name\" . }}\n topologyKey: topology.kubernetes.io/zone\n - weight: 5\n podAffinityTerm:\n labelSelector:\n matchExpressions:\n - key: app\n operator: In\n values:\n - {{ template \"alfresco-transform-service.libreoffice.name\" . }}\n topologyKey: app.kubernetes.io/name"` | Pod affinity, passed thru tpl function | +| libreoffice.autoscaling.behavior.scaleDown.policies | list | `[{"periodSeconds":60,"type":"Pods","value":1}]` | list of available policies for scaling down scale down either by one pod or by destroying 25% of the pods (whichever is smaller) | +| libreoffice.autoscaling.behavior.scaleDown.stabilizationWindowSeconds | int | `60` | | +| libreoffice.autoscaling.behavior.scaleUp.policies | list | `[{"periodSeconds":60,"type":"Percent","value":50},{"periodSeconds":60,"type":"Pods","value":2}]` | list of available policies for scaling up scale up either by one pod or by adding 50% more pods (whichever is bigger) | +| libreoffice.autoscaling.behavior.scaleUp.stabilizationWindowSeconds | int | `30` | | +| libreoffice.autoscaling.enabled | bool | `false` | Toggle libreoffice autoscaling | +| libreoffice.autoscaling.maxReplicas | int | `3` | maximum number of replicas to spin up within the replicaset | +| libreoffice.autoscaling.metrics | list | `[{"resource":{"name":"cpu","target":{"averageUtilization":75,"type":"Utilization"}},"type":"Resource"}]` | a list of resource the HPA controller should monitor For more details check https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-resource-metrics | +| libreoffice.autoscaling.minReplicas | int | `1` | minimum number of replicas to spin up within the replicaset | | libreoffice.enabled | bool | `true` | | | libreoffice.environment.JAVA_OPTS | string | `"-XX:MinRAMPercentage=50 -XX:MaxRAMPercentage=80"` | | | libreoffice.image.internalPort | int | `8090` | | @@ -122,7 +138,7 @@ Checkout [alfresco-content-services chart's doc](https://github.com/Alfresco/acs | libreoffice.podSecurityContext.runAsUser | int | `33003` | | | libreoffice.readinessProbe.initialDelaySeconds | int | `20` | | | libreoffice.readinessProbe.path | string | `"/ready"` | | -| libreoffice.readinessProbe.periodSeconds | int | `60` | | +| libreoffice.readinessProbe.periodSeconds | int | `30` | | | libreoffice.readinessProbe.timeoutSeconds | int | `10` | | | libreoffice.replicaCount | int | `2` | | | libreoffice.resources.limits.cpu | string | `"4"` | | @@ -144,6 +160,14 @@ Checkout [alfresco-content-services chart's doc](https://github.com/Alfresco/acs | messageBroker.url | string | `nil` | Activemq connection url (e.g. failover:(nio://my-broker:61616)?timeout=3000&jms.useCompression=true) | | messageBroker.user | string | `nil` | Activemq username | | pdfrenderer.affinity | string | `"podAntiAffinity:\n preferredDuringSchedulingIgnoredDuringExecution:\n - weight: 10\n podAffinityTerm:\n labelSelector:\n matchExpressions:\n - key: app\n operator: In\n values:\n - {{ template \"alfresco-transform-service.pdfrenderer.name\" . }}\n topologyKey: topology.kubernetes.io/zone\n - weight: 5\n podAffinityTerm:\n labelSelector:\n matchExpressions:\n - key: app\n operator: In\n values:\n - {{ template \"alfresco-transform-service.pdfrenderer.name\" . }}\n topologyKey: app.kubernetes.io/name"` | Pod affinity, passed thru tpl function | +| pdfrenderer.autoscaling.behavior.scaleDown.policies | list | `[{"periodSeconds":60,"type":"Pods","value":1}]` | list of available policies for scaling down scale down either by one pod or by destroying 25% of the pods (whichever is smaller) | +| pdfrenderer.autoscaling.behavior.scaleDown.stabilizationWindowSeconds | int | `60` | | +| pdfrenderer.autoscaling.behavior.scaleUp.policies | list | `[{"periodSeconds":60,"type":"Percent","value":50},{"periodSeconds":60,"type":"Pods","value":2}]` | list of available policies for scaling up scale up either by one pod or by adding 50% more pods (whichever is bigger) | +| pdfrenderer.autoscaling.behavior.scaleUp.stabilizationWindowSeconds | int | `30` | | +| pdfrenderer.autoscaling.enabled | bool | `false` | Toggle pdfrenderer autoscaling | +| pdfrenderer.autoscaling.maxReplicas | int | `3` | maximum number of replicas to spin up within the replicaset | +| pdfrenderer.autoscaling.metrics | list | `[{"resource":{"name":"cpu","target":{"averageUtilization":75,"type":"Utilization"}},"type":"Resource"}]` | a list of resource the HPA controller should monitor For more details check https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-resource-metrics | +| pdfrenderer.autoscaling.minReplicas | int | `1` | minimum number of replicas to spin up within the replicaset | | pdfrenderer.enabled | bool | `true` | | | pdfrenderer.environment.JAVA_OPTS | string | `"-XX:MinRAMPercentage=50 -XX:MaxRAMPercentage=80"` | | | pdfrenderer.image.internalPort | int | `8090` | | @@ -165,7 +189,7 @@ Checkout [alfresco-content-services chart's doc](https://github.com/Alfresco/acs | pdfrenderer.podSecurityContext.runAsUser | int | `33001` | | | pdfrenderer.readinessProbe.initialDelaySeconds | int | `20` | | | pdfrenderer.readinessProbe.path | string | `"/ready"` | | -| pdfrenderer.readinessProbe.periodSeconds | int | `60` | | +| pdfrenderer.readinessProbe.periodSeconds | int | `30` | | | pdfrenderer.readinessProbe.timeoutSeconds | int | `10` | | | pdfrenderer.replicaCount | int | `2` | | | pdfrenderer.resources.limits.cpu | string | `"2"` | | @@ -184,6 +208,14 @@ Checkout [alfresco-content-services chart's doc](https://github.com/Alfresco/acs | serviceAccount.name | string | `""` | | | tags.ci | bool | `false` | Enable dependencies required for CI. Do not enable. | | tika.affinity | string | `"podAntiAffinity:\n preferredDuringSchedulingIgnoredDuringExecution:\n - weight: 10\n podAffinityTerm:\n labelSelector:\n matchExpressions:\n - key: app\n operator: In\n values:\n - {{ template \"alfresco-transform-service.tika.name\" . }}\n topologyKey: topology.kubernetes.io/zone\n - weight: 5\n podAffinityTerm:\n labelSelector:\n matchExpressions:\n - key: app\n operator: In\n values:\n - {{ template \"alfresco-transform-service.tika.name\" . }}\n topologyKey: app.kubernetes.io/name"` | Pod affinity, passed thru tpl function | +| tika.autoscaling.behavior.scaleDown.policies | list | `[{"periodSeconds":60,"type":"Pods","value":1}]` | list of available policies for scaling down scale down either by one pod or by destroying 25% of the pods (whichever is smaller) | +| tika.autoscaling.behavior.scaleDown.stabilizationWindowSeconds | int | `60` | | +| tika.autoscaling.behavior.scaleUp.policies | list | `[{"periodSeconds":60,"type":"Percent","value":50},{"periodSeconds":60,"type":"Pods","value":2}]` | list of available policies for scaling up scale up either by one pod or by adding 50% more pods (whichever is bigger) | +| tika.autoscaling.behavior.scaleUp.stabilizationWindowSeconds | int | `30` | | +| tika.autoscaling.enabled | bool | `false` | Toggle tika autoscaling | +| tika.autoscaling.maxReplicas | int | `3` | maximum number of replicas to spin up within the replicaset | +| tika.autoscaling.metrics | list | `[{"resource":{"name":"cpu","target":{"averageUtilization":75,"type":"Utilization"}},"type":"Resource"}]` | a list of resource the HPA controller should monitor For more details check https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-resource-metrics | +| tika.autoscaling.minReplicas | int | `1` | minimum number of replicas to spin up within the replicaset | | tika.enabled | bool | `true` | | | tika.environment.JAVA_OPTS | string | `"-XX:MinRAMPercentage=50 -XX:MaxRAMPercentage=80"` | | | tika.image.internalPort | int | `8090` | | @@ -205,7 +237,7 @@ Checkout [alfresco-content-services chart's doc](https://github.com/Alfresco/acs | tika.podSecurityContext.runAsUser | int | `33004` | | | tika.readinessProbe.initialDelaySeconds | int | `30` | | | tika.readinessProbe.path | string | `"/ready"` | | -| tika.readinessProbe.periodSeconds | int | `60` | | +| tika.readinessProbe.periodSeconds | int | `30` | | | tika.readinessProbe.timeoutSeconds | int | `10` | | | tika.replicaCount | int | `2` | | | tika.resources.limits.cpu | string | `"4"` | | @@ -219,6 +251,14 @@ Checkout [alfresco-content-services chart's doc](https://github.com/Alfresco/acs | tika.volumeMounts | list | `[]` | | | tika.volumes | list | `[]` | | | transformmisc.affinity | string | `"podAntiAffinity:\n preferredDuringSchedulingIgnoredDuringExecution:\n - weight: 10\n podAffinityTerm:\n labelSelector:\n matchExpressions:\n - key: app\n operator: In\n values:\n - {{ template \"alfresco-transform-service.transform-misc.name\" . }}\n topologyKey: topology.kubernetes.io/zone\n - weight: 5\n podAffinityTerm:\n labelSelector:\n matchExpressions:\n - key: app\n operator: In\n values:\n - {{ template \"alfresco-transform-service.transform-misc.name\" . }}\n topologyKey: app.kubernetes.io/name"` | Pod affinity, passed thru tpl function | +| transformmisc.autoscaling.behavior.scaleDown.policies | list | `[{"periodSeconds":60,"type":"Pods","value":1}]` | list of available policies for scaling down scale down either by one pod or by destroying 25% of the pods (whichever is smaller) | +| transformmisc.autoscaling.behavior.scaleDown.stabilizationWindowSeconds | int | `60` | | +| transformmisc.autoscaling.behavior.scaleUp.policies | list | `[{"periodSeconds":60,"type":"Percent","value":50},{"periodSeconds":60,"type":"Pods","value":2}]` | list of available policies for scaling up scale up either by one pod or by adding 50% more pods (whichever is bigger) | +| transformmisc.autoscaling.behavior.scaleUp.stabilizationWindowSeconds | int | `30` | | +| transformmisc.autoscaling.enabled | bool | `false` | Toggle transformmisc autoscaling | +| transformmisc.autoscaling.maxReplicas | int | `3` | maximum number of replicas to spin up within the replicaset | +| transformmisc.autoscaling.metrics | list | `[{"resource":{"name":"cpu","target":{"averageUtilization":75,"type":"Utilization"}},"type":"Resource"}]` | a list of resource the HPA controller should monitor For more details check https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-resource-metrics | +| transformmisc.autoscaling.minReplicas | int | `1` | minimum number of replicas to spin up within the replicaset | | transformmisc.enabled | bool | `true` | | | transformmisc.environment.JAVA_OPTS | string | `"-XX:MinRAMPercentage=50 -XX:MaxRAMPercentage=80"` | | | transformmisc.image.internalPort | int | `8090` | | @@ -240,7 +280,7 @@ Checkout [alfresco-content-services chart's doc](https://github.com/Alfresco/acs | transformmisc.podSecurityContext.runAsUser | int | `33006` | | | transformmisc.readinessProbe.initialDelaySeconds | int | `20` | | | transformmisc.readinessProbe.path | string | `"/ready"` | | -| transformmisc.readinessProbe.periodSeconds | int | `60` | | +| transformmisc.readinessProbe.periodSeconds | int | `30` | | | transformmisc.readinessProbe.timeoutSeconds | int | `10` | | | transformmisc.replicaCount | int | `2` | | | transformmisc.resources.limits.cpu | string | `"2"` | | diff --git a/charts/alfresco-transform-service/templates/deployment-imagemagick.yaml b/charts/alfresco-transform-service/templates/deployment-imagemagick.yaml index 31705656..f7ce3f4b 100644 --- a/charts/alfresco-transform-service/templates/deployment-imagemagick.yaml +++ b/charts/alfresco-transform-service/templates/deployment-imagemagick.yaml @@ -6,7 +6,9 @@ metadata: labels: {{- include "alfresco-transform-service.imagemagick.labels" . | nindent 4 }} spec: + {{- if not .Values.imagemagick.autoscaling.enabled }} replicas: {{ .Values.imagemagick.replicaCount }} + {{ end }} selector: matchLabels: {{- include "alfresco-transform-service.imagemagick.selectorLabels" . | nindent 6 }} diff --git a/charts/alfresco-transform-service/templates/deployment-libreoffice.yaml b/charts/alfresco-transform-service/templates/deployment-libreoffice.yaml index 3f2268eb..2b8f72f1 100644 --- a/charts/alfresco-transform-service/templates/deployment-libreoffice.yaml +++ b/charts/alfresco-transform-service/templates/deployment-libreoffice.yaml @@ -6,7 +6,9 @@ metadata: labels: {{- include "alfresco-transform-service.libreoffice.labels" . | nindent 4 }} spec: + {{- if not .Values.libreoffice.autoscaling.enabled }} replicas: {{ .Values.libreoffice.replicaCount }} + {{ end }} selector: matchLabels: {{- include "alfresco-transform-service.libreoffice.selectorLabels" . | nindent 6 }} diff --git a/charts/alfresco-transform-service/templates/deployment-pdfrenderer.yaml b/charts/alfresco-transform-service/templates/deployment-pdfrenderer.yaml index 563d7d44..4e2f52c6 100644 --- a/charts/alfresco-transform-service/templates/deployment-pdfrenderer.yaml +++ b/charts/alfresco-transform-service/templates/deployment-pdfrenderer.yaml @@ -6,7 +6,9 @@ metadata: labels: {{- include "alfresco-transform-service.pdfrenderer.labels" . | nindent 4 }} spec: + {{- if not .Values.pdfrenderer.autoscaling.enabled }} replicas: {{ .Values.pdfrenderer.replicaCount }} + {{ end }} selector: matchLabels: {{- include "alfresco-transform-service.pdfrenderer.selectorLabels" . | nindent 6 }} diff --git a/charts/alfresco-transform-service/templates/deployment-tika.yaml b/charts/alfresco-transform-service/templates/deployment-tika.yaml index 0bf844e1..c08191c3 100644 --- a/charts/alfresco-transform-service/templates/deployment-tika.yaml +++ b/charts/alfresco-transform-service/templates/deployment-tika.yaml @@ -6,7 +6,9 @@ metadata: labels: {{- include "alfresco-transform-service.tika.labels" . | nindent 4 }} spec: + {{- if not .Values.tika.autoscaling.enabled }} replicas: {{ .Values.tika.replicaCount }} + {{ end }} selector: matchLabels: {{- include "alfresco-transform-service.tika.selectorLabels" . | nindent 6 }} diff --git a/charts/alfresco-transform-service/templates/deployment-transform-misc.yaml b/charts/alfresco-transform-service/templates/deployment-transform-misc.yaml index c22bff10..a1798462 100644 --- a/charts/alfresco-transform-service/templates/deployment-transform-misc.yaml +++ b/charts/alfresco-transform-service/templates/deployment-transform-misc.yaml @@ -6,7 +6,9 @@ metadata: labels: {{- include "alfresco-transform-service.transform-misc.labels" . | nindent 4 }} spec: + {{- if not .Values.transformmisc.autoscaling.enabled }} replicas: {{ .Values.transformmisc.replicaCount }} + {{ end }} selector: matchLabels: {{- include "alfresco-transform-service.transform-misc.selectorLabels" . | nindent 6 }} diff --git a/charts/alfresco-transform-service/templates/hpa-imagemagick.yaml b/charts/alfresco-transform-service/templates/hpa-imagemagick.yaml new file mode 100644 index 00000000..66bfca5b --- /dev/null +++ b/charts/alfresco-transform-service/templates/hpa-imagemagick.yaml @@ -0,0 +1,16 @@ +{{ if and .Values.imagemagick.enabled .Values.imagemagick.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ template "alfresco-transform-service.imagemagick.name" . }} + labels: {{- include "alfresco-transform-service.imagemagick.labels" . | nindent 4 }} +spec: + minReplicas: {{ .Values.imagemagick.autoscaling.minReplicas }} + maxReplicas: {{ .Values.imagemagick.autoscaling.maxReplicas }} + behavior: {{ toYaml .Values.imagemagick.autoscaling.behavior | nindent 4 }} + metrics: {{ toYaml .Values.imagemagick.autoscaling.metrics | nindent 4 }} + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ template "alfresco-transform-service.imagemagick.name" . }} +{{ end }} diff --git a/charts/alfresco-transform-service/templates/hpa-libreoffice.yaml b/charts/alfresco-transform-service/templates/hpa-libreoffice.yaml new file mode 100644 index 00000000..1c4918e9 --- /dev/null +++ b/charts/alfresco-transform-service/templates/hpa-libreoffice.yaml @@ -0,0 +1,16 @@ +{{ if and .Values.libreoffice.enabled .Values.libreoffice.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ template "alfresco-transform-service.libreoffice.name" . }} + labels: {{- include "alfresco-transform-service.libreoffice.labels" . | nindent 4 }} +spec: + minReplicas: {{ .Values.libreoffice.autoscaling.minReplicas }} + maxReplicas: {{ .Values.libreoffice.autoscaling.maxReplicas }} + behavior: {{ toYaml .Values.libreoffice.autoscaling.behavior | nindent 4 }} + metrics: {{ toYaml .Values.libreoffice.autoscaling.metrics | nindent 4 }} + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ template "alfresco-transform-service.libreoffice.name" . }} +{{ end }} diff --git a/charts/alfresco-transform-service/templates/hpa-pdfrenderer.yaml b/charts/alfresco-transform-service/templates/hpa-pdfrenderer.yaml new file mode 100644 index 00000000..4c86149c --- /dev/null +++ b/charts/alfresco-transform-service/templates/hpa-pdfrenderer.yaml @@ -0,0 +1,16 @@ +{{ if and .Values.pdfrenderer.enabled .Values.pdfrenderer.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ template "alfresco-transform-service.pdfrenderer.name" . }} + labels: {{- include "alfresco-transform-service.pdfrenderer.labels" . | nindent 4 }} +spec: + minReplicas: {{ .Values.pdfrenderer.autoscaling.minReplicas }} + maxReplicas: {{ .Values.pdfrenderer.autoscaling.maxReplicas }} + behavior: {{ toYaml .Values.pdfrenderer.autoscaling.behavior | nindent 4 }} + metrics: {{ toYaml .Values.pdfrenderer.autoscaling.metrics | nindent 4 }} + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ template "alfresco-transform-service.pdfrenderer.name" . }} +{{ end }} diff --git a/charts/alfresco-transform-service/templates/hpa-tika.yaml b/charts/alfresco-transform-service/templates/hpa-tika.yaml new file mode 100644 index 00000000..c3f9caad --- /dev/null +++ b/charts/alfresco-transform-service/templates/hpa-tika.yaml @@ -0,0 +1,16 @@ +{{ if and .Values.tika.enabled .Values.tika.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ template "alfresco-transform-service.tika.name" . }} + labels: {{- include "alfresco-transform-service.tika.labels" . | nindent 4 }} +spec: + minReplicas: {{ .Values.tika.autoscaling.minReplicas }} + maxReplicas: {{ .Values.tika.autoscaling.maxReplicas }} + behavior: {{ toYaml .Values.tika.autoscaling.behavior | nindent 4 }} + metrics: {{ toYaml .Values.tika.autoscaling.metrics | nindent 4 }} + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ template "alfresco-transform-service.tika.name" . }} +{{ end }} diff --git a/charts/alfresco-transform-service/templates/hpa-transform-misc.yaml b/charts/alfresco-transform-service/templates/hpa-transform-misc.yaml new file mode 100644 index 00000000..7b5660fb --- /dev/null +++ b/charts/alfresco-transform-service/templates/hpa-transform-misc.yaml @@ -0,0 +1,16 @@ +{{ if and .Values.transformmisc.enabled .Values.transformmisc.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ template "alfresco-transform-service.transform-misc.name" . }} + labels: {{- include "alfresco-transform-service.transform-misc.labels" . | nindent 4 }} +spec: + minReplicas: {{ .Values.transformmisc.autoscaling.minReplicas }} + maxReplicas: {{ .Values.transformmisc.autoscaling.maxReplicas }} + behavior: {{ toYaml .Values.transformmisc.autoscaling.behavior | nindent 4 }} + metrics: {{ toYaml .Values.transformmisc.autoscaling.metrics | nindent 4 }} + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ template "alfresco-transform-service.transform-misc.name" . }} +{{ end }} diff --git a/charts/alfresco-transform-service/tests/hpa_test.yaml b/charts/alfresco-transform-service/tests/hpa_test.yaml new file mode 100644 index 00000000..a34a533b --- /dev/null +++ b/charts/alfresco-transform-service/tests/hpa_test.yaml @@ -0,0 +1,470 @@ +--- +suite: test ats Horizontal Pod Autoscalers +templates: + - hpa-imagemagick.yaml + - hpa-libreoffice.yaml + - hpa-pdfrenderer.yaml + - hpa-tika.yaml + - hpa-transform-misc.yaml +values: + - values/test_values.yaml +tests: + - it: should render default HPA for imagemagick + set: + imagemagick: + autoscaling: + enabled: true + template: hpa-imagemagick.yaml + asserts: + - equal: + path: metadata.name + value: RELEASE-NAME-imagemagick + - contains: + path: spec.behavior.scaleDown.policies + content: + periodSeconds: 60 + type: Pods + value: 1 + - contains: + path: spec.behavior.scaleUp.policies + content: + periodSeconds: 60 + type: Percent + value: 50 + - contains: + path: spec.behavior.scaleUp.policies + content: + periodSeconds: 60 + type: Pods + value: 2 + - equal: + path: spec.behavior.scaleUp.stabilizationWindowSeconds + value: 30 + - equal: + path: spec.behavior.scaleDown.stabilizationWindowSeconds + value: 60 + + - it: should render default HPA for libreoffice + set: + libreoffice: + autoscaling: + enabled: true + template: hpa-libreoffice.yaml + asserts: + - equal: + path: metadata.name + value: RELEASE-NAME-libreoffice + - contains: + path: spec.behavior.scaleDown.policies + content: + periodSeconds: 60 + type: Pods + value: 1 + - contains: + path: spec.behavior.scaleUp.policies + content: + periodSeconds: 60 + type: Percent + value: 50 + - contains: + path: spec.behavior.scaleUp.policies + content: + periodSeconds: 60 + type: Pods + value: 2 + - equal: + path: spec.behavior.scaleUp.stabilizationWindowSeconds + value: 30 + - equal: + path: spec.behavior.scaleDown.stabilizationWindowSeconds + value: 60 + + - it: should render default HPA for pdfrenderer + set: + pdfrenderer: + autoscaling: + enabled: true + template: hpa-pdfrenderer.yaml + asserts: + - equal: + path: metadata.name + value: RELEASE-NAME-pdfrenderer + - contains: + path: spec.behavior.scaleDown.policies + content: + periodSeconds: 60 + type: Pods + value: 1 + - contains: + path: spec.behavior.scaleUp.policies + content: + periodSeconds: 60 + type: Percent + value: 50 + - contains: + path: spec.behavior.scaleUp.policies + content: + periodSeconds: 60 + type: Pods + value: 2 + - equal: + path: spec.behavior.scaleUp.stabilizationWindowSeconds + value: 30 + - equal: + path: spec.behavior.scaleDown.stabilizationWindowSeconds + value: 60 + + - it: should render default HPA for tika + set: + tika: + autoscaling: + enabled: true + template: hpa-tika.yaml + asserts: + - equal: + path: metadata.name + value: RELEASE-NAME-tika + - contains: + path: spec.behavior.scaleDown.policies + content: + periodSeconds: 60 + type: Pods + value: 1 + - contains: + path: spec.behavior.scaleUp.policies + content: + periodSeconds: 60 + type: Percent + value: 50 + - contains: + path: spec.behavior.scaleUp.policies + content: + periodSeconds: 60 + type: Pods + value: 2 + - equal: + path: spec.behavior.scaleUp.stabilizationWindowSeconds + value: 30 + - equal: + path: spec.behavior.scaleDown.stabilizationWindowSeconds + value: 60 + + - it: should render default HPA for transformmisc + set: + transformmisc: + autoscaling: + enabled: true + template: hpa-transform-misc.yaml + asserts: + - equal: + path: metadata.name + value: RELEASE-NAME-transform-misc + - contains: + path: spec.behavior.scaleDown.policies + content: + periodSeconds: 60 + type: Pods + value: 1 + - contains: + path: spec.behavior.scaleUp.policies + content: + periodSeconds: 60 + type: Percent + value: 50 + - contains: + path: spec.behavior.scaleUp.policies + content: + periodSeconds: 60 + type: Pods + value: 2 + - equal: + path: spec.behavior.scaleUp.stabilizationWindowSeconds + value: 30 + - equal: + path: spec.behavior.scaleDown.stabilizationWindowSeconds + value: 60 + + - it: should render custom HPA for transformmisc + template: hpa-transform-misc.yaml + set: + transformmisc: + autoscaling: + enabled: true + minReplicas: 2 + maxReplicas: 4 + behavior: + scaleDown: + policies: + - periodSeconds: 600 + type: Pods + value: 4 + stabilizationWindowSeconds: 180 + scaleUp: + policies: + - periodSeconds: 600 + type: Percent + value: 400 + stabilizationWindowSeconds: 300 + metrics: + - resource: + name: cpu + target: + averageUtilization: 50 + type: Utilization + type: Resource + asserts: + - contains: + path: spec.behavior.scaleDown.policies + content: + periodSeconds: 600 + type: Pods + value: 4 + - contains: + path: spec.behavior.scaleUp.policies + content: + periodSeconds: 600 + type: Percent + value: 400 + - contains: + path: spec.metrics + content: + type: Resource + resource: + name: cpu + target: + averageUtilization: 50 + type: Utilization + - equal: + path: spec.behavior.scaleDown.stabilizationWindowSeconds + value: 180 + - equal: + path: spec.behavior.scaleUp.stabilizationWindowSeconds + value: 300 + + - it: should render custom HPA for tika + template: hpa-tika.yaml + set: + tika: + autoscaling: + enabled: true + minReplicas: 2 + maxReplicas: 4 + behavior: + scaleDown: + policies: + - periodSeconds: 600 + type: Pods + value: 4 + stabilizationWindowSeconds: 180 + scaleUp: + policies: + - periodSeconds: 600 + type: Percent + value: 400 + stabilizationWindowSeconds: 300 + metrics: + - resource: + name: cpu + target: + averageUtilization: 50 + type: Utilization + type: Resource + asserts: + - contains: + path: spec.behavior.scaleDown.policies + content: + periodSeconds: 600 + type: Pods + value: 4 + - contains: + path: spec.behavior.scaleUp.policies + content: + periodSeconds: 600 + type: Percent + value: 400 + - contains: + path: spec.metrics + content: + type: Resource + resource: + name: cpu + target: + averageUtilization: 50 + type: Utilization + - equal: + path: spec.behavior.scaleDown.stabilizationWindowSeconds + value: 180 + - equal: + path: spec.behavior.scaleUp.stabilizationWindowSeconds + value: 300 + + - it: should render custom HPA for pdfrenderer + template: hpa-pdfrenderer.yaml + set: + pdfrenderer: + autoscaling: + enabled: true + minReplicas: 2 + maxReplicas: 4 + behavior: + scaleDown: + policies: + - periodSeconds: 600 + type: Pods + value: 4 + stabilizationWindowSeconds: 180 + scaleUp: + policies: + - periodSeconds: 600 + type: Percent + value: 400 + stabilizationWindowSeconds: 300 + metrics: + - resource: + name: cpu + target: + averageUtilization: 50 + type: Utilization + type: Resource + asserts: + - contains: + path: spec.behavior.scaleDown.policies + content: + periodSeconds: 600 + type: Pods + value: 4 + - contains: + path: spec.behavior.scaleUp.policies + content: + periodSeconds: 600 + type: Percent + value: 400 + - contains: + path: spec.metrics + content: + type: Resource + resource: + name: cpu + target: + averageUtilization: 50 + type: Utilization + - equal: + path: spec.behavior.scaleDown.stabilizationWindowSeconds + value: 180 + - equal: + path: spec.behavior.scaleUp.stabilizationWindowSeconds + value: 300 + + - it: should render custom HPA for libreoffice + template: hpa-libreoffice.yaml + set: + libreoffice: + autoscaling: + enabled: true + minReplicas: 2 + maxReplicas: 4 + behavior: + scaleDown: + policies: + - periodSeconds: 600 + type: Pods + value: 4 + stabilizationWindowSeconds: 180 + scaleUp: + policies: + - periodSeconds: 600 + type: Percent + value: 400 + stabilizationWindowSeconds: 300 + metrics: + - resource: + name: cpu + target: + averageUtilization: 50 + type: Utilization + type: Resource + asserts: + - contains: + path: spec.behavior.scaleDown.policies + content: + periodSeconds: 600 + type: Pods + value: 4 + - contains: + path: spec.behavior.scaleUp.policies + content: + periodSeconds: 600 + type: Percent + value: 400 + - contains: + path: spec.metrics + content: + type: Resource + resource: + name: cpu + target: + averageUtilization: 50 + type: Utilization + - equal: + path: spec.behavior.scaleDown.stabilizationWindowSeconds + value: 180 + - equal: + path: spec.behavior.scaleUp.stabilizationWindowSeconds + value: 300 + + - it: should render custom HPA for imagemagick + template: hpa-imagemagick.yaml + set: + imagemagick: + autoscaling: + enabled: true + minReplicas: 2 + maxReplicas: 4 + behavior: + scaleDown: + policies: + - periodSeconds: 600 + type: Pods + value: 4 + stabilizationWindowSeconds: 180 + scaleUp: + policies: + - periodSeconds: 600 + type: Percent + value: 400 + stabilizationWindowSeconds: 300 + metrics: + - resource: + name: cpu + target: + averageUtilization: 50 + type: Utilization + type: Resource + asserts: + - contains: + path: spec.behavior.scaleDown.policies + content: + periodSeconds: 600 + type: Pods + value: 4 + - contains: + path: spec.behavior.scaleUp.policies + content: + periodSeconds: 600 + type: Percent + value: 400 + - contains: + path: spec.metrics + content: + type: Resource + resource: + name: cpu + target: + averageUtilization: 50 + type: Utilization + - equal: + path: spec.behavior.scaleDown.stabilizationWindowSeconds + value: 180 + - equal: + path: spec.behavior.scaleUp.stabilizationWindowSeconds + value: 300 diff --git a/charts/alfresco-transform-service/values.yaml b/charts/alfresco-transform-service/values.yaml index 9de89dca..25e3b3f1 100644 --- a/charts/alfresco-transform-service/values.yaml +++ b/charts/alfresco-transform-service/values.yaml @@ -117,7 +117,7 @@ pdfrenderer: readinessProbe: path: /ready initialDelaySeconds: 20 - periodSeconds: 60 + periodSeconds: 30 timeoutSeconds: 10 livenessProbe: path: /live @@ -130,6 +130,43 @@ pdfrenderer: maxTransformSeconds: 1200 volumes: [] volumeMounts: [] + autoscaling: + # -- Toggle pdfrenderer autoscaling + enabled: false + # -- minimum number of replicas to spin up within the replicaset + minReplicas: 1 + # -- maximum number of replicas to spin up within the replicaset + maxReplicas: 3 + behavior: + scaleDown: + # -- list of available policies for scaling down + # scale down either by one pod or by destroying 25% of the pods (whichever is smaller) + policies: + - periodSeconds: 60 + type: Pods + value: 1 + stabilizationWindowSeconds: 60 + scaleUp: + # -- list of available policies for scaling up + # scale up either by one pod or by adding 50% more pods (whichever is bigger) + policies: + - periodSeconds: 60 + type: Percent + value: 50 + - periodSeconds: 60 + type: Pods + value: 2 + stabilizationWindowSeconds: 30 + # -- a list of resource the HPA controller should monitor + # For more details check + # https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-resource-metrics + metrics: + - resource: + name: cpu + target: + averageUtilization: 75 + type: Utilization + type: Resource imagemagick: enabled: true replicaCount: 2 @@ -185,7 +222,7 @@ imagemagick: readinessProbe: path: /ready initialDelaySeconds: 20 - periodSeconds: 60 + periodSeconds: 30 timeoutSeconds: 10 livenessProbe: path: /live @@ -198,6 +235,43 @@ imagemagick: maxTransformSeconds: 900 volumes: [] volumeMounts: [] + autoscaling: + # -- Toggle imagemagick autoscaling + enabled: false + # -- minimum number of replicas to spin up within the replicaset + minReplicas: 1 + # -- maximum number of replicas to spin up within the replicaset + maxReplicas: 3 + behavior: + scaleDown: + # -- list of available policies for scaling down + # scale down either by one pod or by destroying 25% of the pods (whichever is smaller) + policies: + - periodSeconds: 60 + type: Pods + value: 1 + stabilizationWindowSeconds: 60 + scaleUp: + # -- list of available policies for scaling up + # scale up either by one pod or by adding 50% more pods (whichever is bigger) + policies: + - periodSeconds: 60 + type: Percent + value: 50 + - periodSeconds: 60 + type: Pods + value: 2 + stabilizationWindowSeconds: 30 + # -- a list of resource the HPA controller should monitor + # For more details check + # https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-resource-metrics + metrics: + - resource: + name: cpu + target: + averageUtilization: 75 + type: Utilization + type: Resource libreoffice: enabled: true replicaCount: 2 @@ -253,7 +327,7 @@ libreoffice: readinessProbe: path: /ready initialDelaySeconds: 20 - periodSeconds: 60 + periodSeconds: 30 timeoutSeconds: 10 livenessProbe: path: /live @@ -266,6 +340,43 @@ libreoffice: maxTransformSeconds: 1800 volumes: [] volumeMounts: [] + autoscaling: + # -- Toggle libreoffice autoscaling + enabled: false + # -- minimum number of replicas to spin up within the replicaset + minReplicas: 1 + # -- maximum number of replicas to spin up within the replicaset + maxReplicas: 3 + behavior: + scaleDown: + # -- list of available policies for scaling down + # scale down either by one pod or by destroying 25% of the pods (whichever is smaller) + policies: + - periodSeconds: 60 + type: Pods + value: 1 + stabilizationWindowSeconds: 60 + scaleUp: + # -- list of available policies for scaling up + # scale up either by one pod or by adding 50% more pods (whichever is bigger) + policies: + - periodSeconds: 60 + type: Percent + value: 50 + - periodSeconds: 60 + type: Pods + value: 2 + stabilizationWindowSeconds: 30 + # -- a list of resource the HPA controller should monitor + # For more details check + # https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-resource-metrics + metrics: + - resource: + name: cpu + target: + averageUtilization: 75 + type: Utilization + type: Resource tika: enabled: true replicaCount: 2 @@ -321,7 +432,7 @@ tika: readinessProbe: path: /ready initialDelaySeconds: 30 - periodSeconds: 60 + periodSeconds: 30 timeoutSeconds: 10 livenessProbe: path: /live @@ -334,6 +445,43 @@ tika: maxTransformSeconds: 1800 volumes: [] volumeMounts: [] + autoscaling: + # -- Toggle tika autoscaling + enabled: false + # -- minimum number of replicas to spin up within the replicaset + minReplicas: 1 + # -- maximum number of replicas to spin up within the replicaset + maxReplicas: 3 + behavior: + scaleDown: + # -- list of available policies for scaling down + # scale down either by one pod or by destroying 25% of the pods (whichever is smaller) + policies: + - periodSeconds: 60 + type: Pods + value: 1 + stabilizationWindowSeconds: 60 + scaleUp: + # -- list of available policies for scaling up + # scale up either by one pod or by adding 50% more pods (whichever is bigger) + policies: + - periodSeconds: 60 + type: Percent + value: 50 + - periodSeconds: 60 + type: Pods + value: 2 + stabilizationWindowSeconds: 30 + # -- a list of resource the HPA controller should monitor + # For more details check + # https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-resource-metrics + metrics: + - resource: + name: cpu + target: + averageUtilization: 75 + type: Utilization + type: Resource transformmisc: enabled: true replicaCount: 2 @@ -389,7 +537,7 @@ transformmisc: readinessProbe: path: /ready initialDelaySeconds: 20 - periodSeconds: 60 + periodSeconds: 30 timeoutSeconds: 10 livenessProbe: path: /live @@ -402,6 +550,43 @@ transformmisc: maxTransformSeconds: 1800 volumes: [] volumeMounts: [] + autoscaling: + # -- Toggle transformmisc autoscaling + enabled: false + # -- minimum number of replicas to spin up within the replicaset + minReplicas: 1 + # -- maximum number of replicas to spin up within the replicaset + maxReplicas: 3 + behavior: + scaleDown: + # -- list of available policies for scaling down + # scale down either by one pod or by destroying 25% of the pods (whichever is smaller) + policies: + - periodSeconds: 60 + type: Pods + value: 1 + stabilizationWindowSeconds: 60 + scaleUp: + # -- list of available policies for scaling up + # scale up either by one pod or by adding 50% more pods (whichever is bigger) + policies: + - periodSeconds: 60 + type: Percent + value: 50 + - periodSeconds: 60 + type: Pods + value: 2 + stabilizationWindowSeconds: 30 + # -- a list of resource the HPA controller should monitor + # For more details check + # https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-resource-metrics + metrics: + - resource: + name: cpu + target: + averageUtilization: 75 + type: Utilization + type: Resource filestore: enabled: true replicaCount: 1