From fdb6093011df454af5e16ce4dec9042b45bd62ff Mon Sep 17 00:00:00 2001 From: tgauweiler <43210663+tgauweiler@users.noreply.github.com> Date: Mon, 17 Feb 2020 00:46:41 +0100 Subject: [PATCH 1/5] fix: volumeMounts indention for argocd-server (#239) * Fix volumeMounts indention for argocd-server * chore: bump chart version --- charts/argo-cd/Chart.yaml | 2 +- charts/argo-cd/templates/argocd-server/deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index 0f3a5aa1..6a07da99 100644 --- a/charts/argo-cd/Chart.yaml +++ b/charts/argo-cd/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "1.4.2" description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes. name: argo-cd -version: 1.7.5 +version: 1.7.6 home: https://github.com/argoproj/argo-helm icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png keywords: diff --git a/charts/argo-cd/templates/argocd-server/deployment.yaml b/charts/argo-cd/templates/argocd-server/deployment.yaml index fe6e54d5..42b78cdd 100755 --- a/charts/argo-cd/templates/argocd-server/deployment.yaml +++ b/charts/argo-cd/templates/argocd-server/deployment.yaml @@ -76,7 +76,7 @@ spec: {{- end }} volumeMounts: {{- if .Values.server.volumeMounts }} -{{- toYaml .Values.server.volumeMounts | nindent 10}} +{{- toYaml .Values.server.volumeMounts | nindent 8}} {{- end }} {{- if .Values.configs.knownHosts }} - mountPath: /app/config/ssh From d9d786286431285efcab3608fc58abb89852bf05 Mon Sep 17 00:00:00 2001 From: Gustav Paul Date: Sun, 16 Feb 2020 16:14:39 -0800 Subject: [PATCH 2/5] feat: Add HPA for ArgoCD server and repoServer components (#240) * argo-cd: add optional hpa, cleanup whitespace --- charts/argo-cd/Chart.yaml | 2 +- charts/argo-cd/README.md | 10 ++++++ .../deployment.yaml | 2 +- .../argocd-repo-server/deployment.yaml | 4 ++- .../templates/argocd-repo-server/hpa.yaml | 33 +++++++++++++++++++ .../templates/argocd-server/deployment.yaml | 4 ++- .../argo-cd/templates/argocd-server/hpa.yaml | 33 +++++++++++++++++++ charts/argo-cd/values.yaml | 14 ++++++++ 8 files changed, 98 insertions(+), 4 deletions(-) create mode 100644 charts/argo-cd/templates/argocd-repo-server/hpa.yaml create mode 100644 charts/argo-cd/templates/argocd-server/hpa.yaml diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index 6a07da99..0904bc0d 100644 --- a/charts/argo-cd/Chart.yaml +++ b/charts/argo-cd/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "1.4.2" description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes. name: argo-cd -version: 1.7.6 +version: 1.8.0 home: https://github.com/argoproj/argo-helm icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png keywords: diff --git a/charts/argo-cd/README.md b/charts/argo-cd/README.md index 04d337cc..da37209b 100644 --- a/charts/argo-cd/README.md +++ b/charts/argo-cd/README.md @@ -101,6 +101,11 @@ Helm v3 has removed the `install-crds` hook so CRDs are now populated by files i | Key | Type | Default | Description | |-----|------|---------|-------------| | repoServer.affinity | Assign custom affinity rules to the deployment https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ | `{}` | +| repoServer.autoscaling.enabled | Enable Horizontal Pod Autoscaler (HPA) for the repo server | `false` | +| repoServer.autoscaling.minReplicas | Minimum number of replicas for the repo server HPA | `1` | +| repoServer.autoscaling.maxReplicas | Maximum number of replicas for the repo server HPA | `5` | +| repoServer.autoscaling.targetCPUUtilizationPercentage | Average CPU utilization percentage for the repo server HPA | `50` | +| repoServer.autoscaling.targetMemoryUtilizationPercentage | Average memory utilization percentage for the repo server HPA | `50` | | repoServer.containerPort | Repo server port | `8081` | | repoServer.extraArgs | Additional arguments for the repo server. A list of key:value pairs. | `[]` | | repoServer.env | Environment variables for the repo server. | `[]` | @@ -143,6 +148,11 @@ Helm v3 has removed the `install-crds` hook so CRDs are now populated by files i | Key | Type | Default | Description | |-----|------|---------|-------------| | server.affinity | Assign custom affinity rules to the deployment https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ | `{}` | +| server.autoscaling.enabled | Enable Horizontal Pod Autoscaler (HPA) for the server | `false` | +| server.autoscaling.minReplicas | Minimum number of replicas for the server HPA | `1` | +| server.autoscaling.maxReplicas | Maximum number of replicas for the server HPA | `5` | +| server.autoscaling.targetCPUUtilizationPercentage | Average CPU utilization percentage for the server HPA | `50` | +| server.autoscaling.targetMemoryUtilizationPercentage | Average memory utilization percentage for the server HPA | `50` | | server.certificate.additionalHosts | Certificate manager additional hosts | `[]` | | server.certificate.domain | Certificate manager domain | `"argocd.example.com"` | | server.certificate.enabled | Enables a certificate manager certificate. | `false` | diff --git a/charts/argo-cd/templates/argocd-application-controller/deployment.yaml b/charts/argo-cd/templates/argocd-application-controller/deployment.yaml index 286fb981..9c13b535 100755 --- a/charts/argo-cd/templates/argocd-application-controller/deployment.yaml +++ b/charts/argo-cd/templates/argocd-application-controller/deployment.yaml @@ -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 }} diff --git a/charts/argo-cd/templates/argocd-repo-server/deployment.yaml b/charts/argo-cd/templates/argocd-repo-server/deployment.yaml index 918accd4..cb4dffa0 100755 --- a/charts/argo-cd/templates/argocd-repo-server/deployment.yaml +++ b/charts/argo-cd/templates/argocd-repo-server/deployment.yaml @@ -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 }} diff --git a/charts/argo-cd/templates/argocd-repo-server/hpa.yaml b/charts/argo-cd/templates/argocd-repo-server/hpa.yaml new file mode 100644 index 00000000..860e70f4 --- /dev/null +++ b/charts/argo-cd/templates/argocd-repo-server/hpa.yaml @@ -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 }} diff --git a/charts/argo-cd/templates/argocd-server/deployment.yaml b/charts/argo-cd/templates/argocd-server/deployment.yaml index 42b78cdd..1c1d1072 100755 --- a/charts/argo-cd/templates/argocd-server/deployment.yaml +++ b/charts/argo-cd/templates/argocd-server/deployment.yaml @@ -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 }} diff --git a/charts/argo-cd/templates/argocd-server/hpa.yaml b/charts/argo-cd/templates/argocd-server/hpa.yaml new file mode 100644 index 00000000..0da43850 --- /dev/null +++ b/charts/argo-cd/templates/argocd-server/hpa.yaml @@ -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 }} diff --git a/charts/argo-cd/values.yaml b/charts/argo-cd/values.yaml index f2d22c4c..e88c2f8c 100755 --- a/charts/argo-cd/values.yaml +++ b/charts/argo-cd/values.yaml @@ -271,6 +271,13 @@ server: replicas: 1 + autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 5 + targetCPUUtilizationPercentage: 50 + targetMemoryUtilizationPercentage: 50 + image: repository: # argoproj/argocd tag: # v1.4.2 @@ -519,6 +526,13 @@ repoServer: replicas: 1 + autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 5 + targetCPUUtilizationPercentage: 50 + targetMemoryUtilizationPercentage: 50 + image: repository: # argoproj/argocd tag: # v1.4.2 From 7ba77fde189008fa106fb4f07f9119b5bcc7f601 Mon Sep 17 00:00:00 2001 From: "David J. M. Karlsen" Date: Sat, 22 Feb 2020 03:14:00 +0100 Subject: [PATCH 3/5] feat: use globalsecuritycontext for dex too, trim whitespace (#248) Signed-off-by: David Karlsen --- charts/argo-cd/Chart.yaml | 2 +- charts/argo-cd/templates/dex/deployment.yaml | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index 0904bc0d..03798136 100644 --- a/charts/argo-cd/Chart.yaml +++ b/charts/argo-cd/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "1.4.2" description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes. name: argo-cd -version: 1.8.0 +version: 1.8.1 home: https://github.com/argoproj/argo-helm icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png keywords: diff --git a/charts/argo-cd/templates/dex/deployment.yaml b/charts/argo-cd/templates/dex/deployment.yaml index 21b2d26d..fd8c606a 100755 --- a/charts/argo-cd/templates/dex/deployment.yaml +++ b/charts/argo-cd/templates/dex/deployment.yaml @@ -10,7 +10,7 @@ metadata: app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/part-of: argocd app.kubernetes.io/component: {{ .Values.dex.name }} - app.kubernetes.io/version: {{ .Values.dex.image.tag }} + app.kubernetes.io/version: {{ .Values.dex.image.tag }} spec: selector: matchLabels: @@ -25,17 +25,20 @@ spec: app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/part-of: argocd app.kubernetes.io/component: {{ .Values.dex.name }} - app.kubernetes.io/version: {{ .Values.dex.image.tag }} + app.kubernetes.io/version: {{ .Values.dex.image.tag }} spec: + {{- if .Values.global.securityContext }} + securityContext: {{- toYaml .Values.global.securityContext | nindent 8 }} + {{- end }} initContainers: - name: copyutil image: {{ default .Values.global.image.repository .Values.dex.initImage.repository }}:{{ default .Values.global.image.tag .Values.dex.initImage.tag }} imagePullPolicy: {{ default .Values.global.image.imagePullPolicy .Values.dex.initImage.imagePullPolicy }} resources: -{{- toYaml .Values.dex.resources | nindent 10 }} +{{- toYaml .Values.dex.resources | nindent 10 }} {{- if .Values.dex.containerSecurityContext }} securityContext: {{- toYaml .Values.dex.containerSecurityContext | nindent 10 }} - {{- end }} + {{- end }} command: - cp - /usr/local/bin/argocd-util @@ -52,7 +55,7 @@ spec: - rundex {{- if .Values.dex.containerSecurityContext }} securityContext: {{- toYaml .Values.dex.containerSecurityContext | nindent 10 }} - {{- end }} + {{- end }} {{- if .Values.dex.env }} env: {{- toYaml .Values.dex.env | nindent 8 }} From c8db341fdbae4897d056dd4b0d792e922be65b1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Arg=C3=BCello=20Flores?= Date: Sat, 22 Feb 2020 11:55:40 +0900 Subject: [PATCH 4/5] fix: reorder hpa metrics to avoid displaying diffs in argocd (#245) * fix: reorder hpa metrics to avoid displaying diffs in argocd --- charts/argo-cd/Chart.yaml | 2 +- charts/argo-cd/templates/argocd-repo-server/hpa.yaml | 12 ++++++------ charts/argo-cd/templates/argocd-server/hpa.yaml | 12 ++++++------ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index 03798136..2b011fc3 100644 --- a/charts/argo-cd/Chart.yaml +++ b/charts/argo-cd/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "1.4.2" description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes. name: argo-cd -version: 1.8.1 +version: 1.8.2 home: https://github.com/argoproj/argo-helm icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png keywords: diff --git a/charts/argo-cd/templates/argocd-repo-server/hpa.yaml b/charts/argo-cd/templates/argocd-repo-server/hpa.yaml index 860e70f4..103c9955 100644 --- a/charts/argo-cd/templates/argocd-repo-server/hpa.yaml +++ b/charts/argo-cd/templates/argocd-repo-server/hpa.yaml @@ -18,16 +18,16 @@ spec: 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 }} +{{- with .Values.repoServer.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ . }} +{{- end }} {{- end }} diff --git a/charts/argo-cd/templates/argocd-server/hpa.yaml b/charts/argo-cd/templates/argocd-server/hpa.yaml index 0da43850..be947ef0 100644 --- a/charts/argo-cd/templates/argocd-server/hpa.yaml +++ b/charts/argo-cd/templates/argocd-server/hpa.yaml @@ -18,16 +18,16 @@ spec: 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 }} +{{- with .Values.server.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ . }} +{{- end }} {{- end }} From 400f141dae386bea0ad6ac68a0c3ac0d6f0d3789 Mon Sep 17 00:00:00 2001 From: Arnar Date: Wed, 26 Feb 2020 06:37:56 +0100 Subject: [PATCH 5/5] fix: Fixing podLabels in deployment templates (#251) * Fixing podLabels in deployment templates * Updating chart version --- charts/argo-cd/Chart.yaml | 2 +- charts/argo-cd/templates/argocd-repo-server/deployment.yaml | 4 ++-- charts/argo-cd/templates/argocd-server/deployment.yaml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index 2b011fc3..160d33ba 100644 --- a/charts/argo-cd/Chart.yaml +++ b/charts/argo-cd/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "1.4.2" description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes. name: argo-cd -version: 1.8.2 +version: 1.8.3 home: https://github.com/argoproj/argo-helm icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png keywords: diff --git a/charts/argo-cd/templates/argocd-repo-server/deployment.yaml b/charts/argo-cd/templates/argocd-repo-server/deployment.yaml index cb4dffa0..946bbef3 100755 --- a/charts/argo-cd/templates/argocd-repo-server/deployment.yaml +++ b/charts/argo-cd/templates/argocd-repo-server/deployment.yaml @@ -35,8 +35,8 @@ spec: app.kubernetes.io/part-of: argocd app.kubernetes.io/component: {{ .Values.repoServer.name }} app.kubernetes.io/version: {{ default .Values.global.image.tag .Values.repoServer.image.tag | quote }} - {{- if .Values.controller.podLabels }} -{{- toYaml .Values.controller.podLabels | nindent 8 }} + {{- if .Values.repoServer.podLabels }} +{{- toYaml .Values.repoServer.podLabels | nindent 8 }} {{- end }} spec: {{- if .Values.global.securityContext }} diff --git a/charts/argo-cd/templates/argocd-server/deployment.yaml b/charts/argo-cd/templates/argocd-server/deployment.yaml index 1c1d1072..c5d1395c 100755 --- a/charts/argo-cd/templates/argocd-server/deployment.yaml +++ b/charts/argo-cd/templates/argocd-server/deployment.yaml @@ -35,8 +35,8 @@ spec: app.kubernetes.io/part-of: argocd app.kubernetes.io/component: {{ .Values.server.name }} app.kubernetes.io/version: {{ default .Values.global.image.tag .Values.server.image.tag | quote }} - {{- if .Values.controller.podLabels }} -{{- toYaml .Values.controller.podLabels | nindent 8 }} + {{- if .Values.server.podLabels }} +{{- toYaml .Values.server.podLabels | nindent 8 }} {{- end }} spec: {{- if .Values.global.securityContext }}