-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add autoscaling and PDB templates to Helm chart
- Loading branch information
1 parent
3961574
commit b887b70
Showing
4 changed files
with
120 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{{- if .Values.server.autoscaling }} | ||
apiVersion: autoscaling/v2 | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: {{ include "doorkeeper.fullname" . }} | ||
labels: | ||
{{- include "doorkeeper.labels" . | nindent 4 }} | ||
{{- with .Values.server.extraLabels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
|
||
{{- with .Values.server.autoscaling.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
|
||
spec: | ||
{{- if .Values.server.autoscaling.behavior }} | ||
behavior: | ||
{{- toYaml .Values.server.autoscaling.behavior | nindent 4 }} | ||
{{- end }} | ||
|
||
# Match the generated Deployment by reference | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: {{ include "doorkeeper.fullname" . }} | ||
|
||
{{- with .Values.server.autoscaling }} | ||
minReplicas: {{ .minReplicas }} | ||
maxReplicas: {{ .maxReplicas }} | ||
|
||
metrics: | ||
# Changing the order of the metrics will cause ArgoCD | ||
# to go into a sync loop memory needs to be first. | ||
# More info in: https://github.com/argoproj/argo-cd/issues/1079 | ||
{{- with .targetMemoryUtilizationPercentage }} | ||
- type: Resource | ||
resource: | ||
name: memory | ||
target: | ||
type: Utilization | ||
averageUtilization: {{ . }} | ||
{{- end }} | ||
|
||
{{- with .targetCPUUtilizationPercentage }} | ||
- type: Resource | ||
resource: | ||
name: cpu | ||
target: | ||
type: Utilization | ||
averageUtilization: {{ . }} | ||
{{- end }} | ||
|
||
{{- if .customRules -}} | ||
{{- toYaml .customRules | nindent 4}} | ||
{{- end }} | ||
|
||
{{- end }} | ||
|
||
--- | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
{{- if .Values.server.disruption }} | ||
apiVersion: policy/v1 | ||
kind: PodDisruptionBudget | ||
metadata: | ||
name: {{ include "doorkeeper.fullname" . }} | ||
labels: | ||
{{- include "doorkeeper.labels" . | nindent 4 }} | ||
{{- with .Values.server.extraLabels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
|
||
{{- with .Values.server.disruption.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
|
||
|
||
spec: | ||
{{- with .Values.server.disruption.minAvailable }} | ||
minAvailable: {{ . }} | ||
{{- end }} | ||
|
||
{{- with .Values.server.disruption.maxUnavailable }} | ||
maxUnavailable: {{ . }} | ||
{{- end }} | ||
|
||
selector: | ||
matchLabels: | ||
{{- include "doorkeeper.selectorLabels" . | nindent 4 }} | ||
{{- with .Values.server.extraLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
--- | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters