Skip to content

Commit

Permalink
Support HorizontalPodAutoscaler #27
Browse files Browse the repository at this point in the history
  • Loading branch information
tung2744 authored May 3, 2024
2 parents e04a192 + 35f3d9c commit da327cb
Show file tree
Hide file tree
Showing 10 changed files with 168 additions and 2 deletions.
12 changes: 11 additions & 1 deletion .cr-index/index.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
apiVersion: v1
entries:
authgear:
- apiVersion: v2
appVersion: 0.1.0
created: "2024-05-03T18:46:36.820013+08:00"
description: A Helm chart for Authgear
digest: a356319061bba98e52f00f9033207c2d9ce9d31ce26173d44217ea5294d4b3c2
name: authgear
type: application
urls:
- https://github.com/authgear/helm-charts/releases/download/authgear-10.8.0/authgear-10.8.0.tgz
version: 10.8.0
- apiVersion: v2
appVersion: 0.1.0
created: "2024-04-26T11:08:51.276542+08:00"
Expand Down Expand Up @@ -1001,4 +1011,4 @@ entries:
urls:
- https://github.com/authgear/helm-charts/releases/download/authgear-0.1.0/authgear-0.1.0.tgz
version: 0.1.0
generated: "2024-04-26T11:09:07.654863+08:00"
generated: "2024-05-03T18:46:55.90854+08:00"
Binary file added .cr-release-packages/authgear-10.8.0.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion authgear/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
type: application
name: authgear
description: A Helm chart for Authgear
version: 10.7.0
version: 10.8.0
appVersion: 0.1.0
16 changes: 16 additions & 0 deletions authgear/templates/authgear-admin-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,19 @@ spec:
externalName: {{ include "authgear.nameAdmin" . }}.{{ .Release.Namespace }}.svc.cluster.local
ports:
- port: 80
{{- if .Values.authgear.adminServer.hpa.enabled }}
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "authgear.nameAdmin" . | quote }}
spec:
minReplicas: {{ .Values.authgear.adminServer.replicas }}
maxReplicas: {{ .Values.authgear.adminServer.hpa.maxReplicas }}
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "authgear.nameAdmin" . | quote }}
metrics:
{{- toYaml .Values.authgear.adminServer.hpa.metrics | nindent 4 }}
{{- end }}
16 changes: 16 additions & 0 deletions authgear/templates/authgear-deno.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,19 @@ spec:
name: http
selector:
{{- include "authgear.denoSelectorLabels" . | nindent 4 }}
{{- if .Values.authgear.deno.hpa.enabled }}
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "authgear.nameDeno" . | quote }}
spec:
minReplicas: {{ .Values.authgear.deno.replicas }}
maxReplicas: {{ .Values.authgear.deno.hpa.maxReplicas }}
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "authgear.nameDeno" . | quote }}
metrics:
{{- toYaml .Values.authgear.deno.hpa.metrics | nindent 4 }}
{{- end }}
16 changes: 16 additions & 0 deletions authgear/templates/authgear-images-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,19 @@ spec:
externalName: {{ include "authgear.nameImages" . }}.{{ .Release.Namespace }}.svc.cluster.local
ports:
- port: 80
{{- if .Values.authgear.imagesServer.hpa.enabled }}
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "authgear.nameImages" . | quote }}
spec:
minReplicas: {{ .Values.authgear.imagesServer.replicas }}
maxReplicas: {{ .Values.authgear.imagesServer.hpa.maxReplicas }}
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "authgear.nameImages" . | quote }}
metrics:
{{- toYaml .Values.authgear.imagesServer.hpa.metrics | nindent 4 }}
{{- end }}
16 changes: 16 additions & 0 deletions authgear/templates/authgear-main-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,19 @@ spec:
externalName: {{ include "authgear.nameMain" . }}.{{ .Release.Namespace }}.svc.cluster.local
ports:
- port: 80
{{- if .Values.authgear.mainServer.hpa.enabled }}
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "authgear.nameMain" . | quote }}
spec:
minReplicas: {{ .Values.authgear.mainServer.replicas }}
maxReplicas: {{ .Values.authgear.mainServer.hpa.maxReplicas }}
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "authgear.nameMain" . | quote }}
metrics:
{{- toYaml .Values.authgear.mainServer.hpa.metrics | nindent 4 }}
{{- end }}
16 changes: 16 additions & 0 deletions authgear/templates/authgear-portal-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -338,3 +338,19 @@ spec:
name: http
selector:
{{- include "authgear.portalSelectorLabels" . | nindent 4 }}
{{- if .Values.authgear.portalServer.hpa.enabled }}
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "authgear.namePortal" . | quote }}
spec:
minReplicas: {{ .Values.authgear.portalServer.replicas }}
maxReplicas: {{ .Values.authgear.portalServer.hpa.maxReplicas }}
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "authgear.namePortal" . | quote }}
metrics:
{{- toYaml .Values.authgear.portalServer.hpa.metrics | nindent 4 }}
{{- end }}
16 changes: 16 additions & 0 deletions authgear/templates/authgear-resolver-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,19 @@ spec:
externalName: {{ include "authgear.nameResolver" . }}.{{ .Release.Namespace }}.svc.cluster.local
ports:
- port: 80
{{- if .Values.authgear.resolverServer.hpa.enabled }}
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "authgear.nameResolver" . | quote }}
spec:
minReplicas: {{ .Values.authgear.resolverServer.replicas }}
maxReplicas: {{ .Values.authgear.resolverServer.hpa.maxReplicas }}
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "authgear.nameResolver" . | quote }}
metrics:
{{- toYaml .Values.authgear.resolverServer.hpa.metrics | nindent 4 }}
{{- end }}
60 changes: 60 additions & 0 deletions authgear/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,16 @@ authgear:
httpGet:
path: /healthz
port: http
hpa:
enabled: false
maxReplicas: 1
metrics:
- resource:
name: cpu
target:
averageUtilization: 1000
type: Utilization
type: Resource

adminServer:
replicas: 1
Expand All @@ -195,6 +205,16 @@ authgear:
httpGet:
path: /healthz
port: http
hpa:
enabled: false
maxReplicas: 1
metrics:
- resource:
name: cpu
target:
averageUtilization: 1000
type: Utilization
type: Resource

resolverServer:
replicas: 1
Expand All @@ -218,6 +238,16 @@ authgear:
httpGet:
path: /healthz
port: http
hpa:
enabled: false
maxReplicas: 1
metrics:
- resource:
name: cpu
target:
averageUtilization: 1000
type: Utilization
type: Resource

background:
replicas: 1
Expand Down Expand Up @@ -275,6 +305,16 @@ authgear:
httpGet:
path: /healthz
port: http
hpa:
enabled: false
maxReplicas: 1
metrics:
- resource:
name: cpu
target:
averageUtilization: 200
type: Utilization
type: Resource

portalServerProxy:
image: nginx:1.18
Expand Down Expand Up @@ -322,6 +362,16 @@ authgear:
httpGet:
path: /healthz
port: portal
hpa:
enabled: false
maxReplicas: 1
metrics:
- resource:
name: cpu
target:
averageUtilization: 1000
type: Utilization
type: Resource

deno:
image: __replace_me__
Expand All @@ -338,6 +388,16 @@ authgear:
limits:
cpu: 500m
memory: 256Mi
hpa:
enabled: false
maxReplicas: 1
metrics:
- resource:
name: cpu
target:
averageUtilization: 1000
type: Utilization
type: Resource

appCustomResources:
path: ""
Expand Down

0 comments on commit da327cb

Please sign in to comment.