Skip to content

Commit

Permalink
Feature/enable autoscale (#15)
Browse files Browse the repository at this point in the history
* add pod autoscale-support

* bump version
  • Loading branch information
Kurt108 authored Nov 11, 2020
1 parent a26e1e9 commit 167cc47
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/gotenberg/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ appVersion: "6.3.0"
description: Gotenberg is a Docker-powered stateless API for converting HTML, Markdown and Office documents to PDF.
name: gotenberg
icon: https://user-images.githubusercontent.com/8983173/69229423-ac731300-0b85-11ea-8c2e-2cc00ecdb269.PNG
version: 2.1.3
version: 2.1.4
home: https://thecodingmachine.github.io/gotenberg/
sources:
- https://github.com/thecodingmachine/gotenberg
Expand Down
6 changes: 5 additions & 1 deletion charts/gotenberg/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
=========
Gotenberg is a Docker-powered stateless API for converting HTML, Markdown and Office documents to PDF.

Current chart version is `2.1.3`
Current chart version is `2.1.4`

## Installing the Chart

Expand All @@ -30,6 +30,10 @@ NAME: my-release
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| annotations | object | `{}` | |
| autoscaling.enabled | bool | `false` | |
| autoscaling.maxReplicas | int | `1` | |
| autoscaling.minReplicas | int | `1` | |
| autoscaling.targetCPUUtilizationPercentage | int | `80` | |
| basicAuth.enabled | bool | `false` | |
| basicAuth.passwordMD5 | string | `"$apr1$zQ7F0fKS$X3aXkUCufHQlVe51VWUKu1"` | |
| basicAuth.username | string | `"convert"` | |
Expand Down
29 changes: 29 additions & 0 deletions charts/gotenberg/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "gotenberg.fullname" . }}
labels:
app: {{ template "gotenberg.name" . }}
release: {{ .Release.Name }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "gotenberg.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
7 changes: 7 additions & 0 deletions charts/gotenberg/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ resources: {}
# cpu: 600m
# memory: 512Mi

autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 1
targetCPUUtilizationPercentage: 80


nodeSelector: {}

tolerations: []
Expand Down
2 changes: 1 addition & 1 deletion charts/thumbor/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
name: thumbor
icon: https://camo.githubusercontent.com/8add159463b5ef31481d1e0cc9fb590cd662fe62/68747470733a2f2f73332e65752d776573742d322e616d617a6f6e6177732e636f6d2f6d696e696d616c2d636f6d706163742f696d616765732f6d632d7468756d626f722e706e67
version: 1.0.5
version: 1.0.6
appVersion: "6.7.5"
description: A chart containing Thumbor
home: http://thumbor.org/
Expand Down
6 changes: 5 additions & 1 deletion charts/thumbor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
=======
A chart containing Thumbor

Current chart version is `1.0.5`
Current chart version is `1.0.6`

## Based on

Expand All @@ -32,6 +32,10 @@ NAME: my-release

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| autoscaling.enabled | bool | `false` | |
| autoscaling.maxReplicas | int | `1` | |
| autoscaling.minReplicas | int | `1` | |
| autoscaling.targetCPUUtilizationPercentage | int | `80` | |
| auth.enabled | bool | `true` | |
| auth.password | string | `"$1$nwVVjM_Y$VeLOyr0CIIMXQajJL2pXT1"` | |
| auth.username | string | `"thumbor"` | |
Expand Down
29 changes: 29 additions & 0 deletions charts/thumbor/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "thumbor.fullname" . }}
labels:
app: {{ template "thumbor.name" . }}
release: {{ .Release.Name }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "thumbor.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
6 changes: 6 additions & 0 deletions charts/thumbor/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,9 @@ resources:
requests:
cpu: 1
memory: 512Mi

autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 1
targetCPUUtilizationPercentage: 80

0 comments on commit 167cc47

Please sign in to comment.