feat: Add HPA for ArgoCD server and repoServer components (#240)
* argo-cd: add optional hpa, cleanup whitespace
This commit is contained in:
parent
fdb6093011
commit
d9d7862864
8 changed files with 98 additions and 4 deletions
|
|
@ -68,7 +68,7 @@ spec:
|
|||
name: {{ .Values.controller.name }}
|
||||
{{- if .Values.controller.containerSecurityContext }}
|
||||
securityContext: {{- toYaml .Values.controller.containerSecurityContext | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.controller.env }}
|
||||
env:
|
||||
{{- toYaml .Values.controller.env | nindent 8 }}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,9 @@ spec:
|
|||
app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.repoServer.name }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
revisionHistoryLimit: 5
|
||||
{{- if (ne .Values.repoServer.autoscaling.enabled true) }}
|
||||
replicas: {{ .Values.repoServer.replicas }}
|
||||
{{- end }}
|
||||
template:
|
||||
metadata:
|
||||
{{- if .Values.repoServer.podAnnotations }}
|
||||
|
|
@ -61,7 +63,7 @@ spec:
|
|||
{{- end }}
|
||||
{{- if .Values.repoServer.containerSecurityContext }}
|
||||
securityContext: {{- toYaml .Values.repoServer.containerSecurityContext | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.repoServer.env }}
|
||||
env:
|
||||
{{- toYaml .Values.repoServer.env | nindent 8 }}
|
||||
|
|
|
|||
33
charts/argo-cd/templates/argocd-repo-server/hpa.yaml
Normal file
33
charts/argo-cd/templates/argocd-repo-server/hpa.yaml
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{{- if .Values.repoServer.autoscaling.enabled }}
|
||||
apiVersion: autoscaling/v2beta1
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.repoServer.name }}-hpa
|
||||
helm.sh/chart: {{ include "argo-cd.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
app.kubernetes.io/part-of: argocd
|
||||
app.kubernetes.io/component: {{ .Values.repoServer.name }}
|
||||
name: {{ template "argo-cd.repoServer.fullname" . }}-hpa
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: {{ template "argo-cd.repoServer.fullname" . }}
|
||||
minReplicas: {{ .Values.repoServer.autoscaling.minReplicas }}
|
||||
maxReplicas: {{ .Values.repoServer.autoscaling.maxReplicas }}
|
||||
metrics:
|
||||
{{- with .Values.repoServer.autoscaling.targetCPUUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
targetAverageUtilization: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .Values.repoServer.autoscaling.targetMemoryUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: memory
|
||||
targetAverageUtilization: {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -16,7 +16,9 @@ spec:
|
|||
app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.server.name }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
revisionHistoryLimit: 5
|
||||
{{- if (ne .Values.server.autoscaling.enabled true) }}
|
||||
replicas: {{ .Values.server.replicas }}
|
||||
{{- end }}
|
||||
template:
|
||||
metadata:
|
||||
{{- if .Values.server.podAnnotations }}
|
||||
|
|
@ -69,7 +71,7 @@ spec:
|
|||
{{- end }}
|
||||
{{- if .Values.server.containerSecurityContext }}
|
||||
securityContext: {{- toYaml .Values.server.containerSecurityContext | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.server.env }}
|
||||
env:
|
||||
{{- toYaml .Values.server.env | nindent 8 }}
|
||||
|
|
|
|||
33
charts/argo-cd/templates/argocd-server/hpa.yaml
Normal file
33
charts/argo-cd/templates/argocd-server/hpa.yaml
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{{- if .Values.server.autoscaling.enabled }}
|
||||
apiVersion: autoscaling/v2beta1
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.server.name }}-hpa
|
||||
helm.sh/chart: {{ include "argo-cd.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
app.kubernetes.io/part-of: argocd
|
||||
app.kubernetes.io/component: {{ .Values.server.name }}
|
||||
name: {{ template "argo-cd.server.fullname" . }}-hpa
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: {{ template "argo-cd.server.fullname" . }}
|
||||
minReplicas: {{ .Values.server.autoscaling.minReplicas }}
|
||||
maxReplicas: {{ .Values.server.autoscaling.maxReplicas }}
|
||||
metrics:
|
||||
{{- with .Values.server.autoscaling.targetCPUUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
targetAverageUtilization: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .Values.server.autoscaling.targetMemoryUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: memory
|
||||
targetAverageUtilization: {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue