From ec04e0c0435821cd4ed4b298b175cb7d92566192 Mon Sep 17 00:00:00 2001 From: jeroenlanckmans Date: Mon, 9 Dec 2019 01:22:51 +0100 Subject: [PATCH 1/2] Allow custom tools for argo-cd in helm chart (#177) * enable custom tools in argo helm chart * add examples * bump chart version --- charts/argo-cd/Chart.yaml | 2 +- .../argocd-repo-server/deployment.yaml | 8 +++++-- charts/argo-cd/values.yaml | 22 +++++++++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index ffef11df..4cf918c4 100644 --- a/charts/argo-cd/Chart.yaml +++ b/charts/argo-cd/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "1.3.0" description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes. name: argo-cd -version: 1.4.1 +version: 1.4.2 home: https://github.com/argoproj/argo-helm icon: https://raw.githubusercontent.com/argoproj/argo/master/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 91df20fd..0c66a115 100644 --- a/charts/argo-cd/templates/argocd-repo-server/deployment.yaml +++ b/charts/argo-cd/templates/argocd-repo-server/deployment.yaml @@ -60,7 +60,7 @@ spec: {{- end }} volumeMounts: {{- if .Values.repoServer.volumeMounts }} -{{- toYaml .Values.repoServer.volumeMounts | nindent 10}} +{{- toYaml .Values.repoServer.volumeMounts | nindent 8}} {{- end }} {{- if .Values.configs.knownHosts }} - mountPath: /app/config/ssh @@ -112,7 +112,7 @@ spec: serviceAccountName: {{ template "argo-cd.repoServerServiceAccountName" . }} volumes: {{- if .Values.repoServer.volumes }} -{{- toYaml .Values.repoServer.volumes | nindent 8}} +{{- toYaml .Values.repoServer.volumes | nindent 6}} {{- end }} {{- if .Values.configs.knownHosts }} - configMap: @@ -124,3 +124,7 @@ spec: name: argocd-tls-certs-cm name: tls-certs {{- end }} + {{- if .Values.repoServer.initContainers }} + initContainers: +{{- toYaml .Values.repoServer.initContainers | nindent 6 }} + {{- end }} diff --git a/charts/argo-cd/values.yaml b/charts/argo-cd/values.yaml index b4d65554..0b7f2ae7 100644 --- a/charts/argo-cd/values.yaml +++ b/charts/argo-cd/values.yaml @@ -554,6 +554,28 @@ repoServer: # - list # - watch + ## Use init containers to configure custom tooling + ## https://argoproj.github.io/argo-cd/operator-manual/custom_tools/ + ## When using the volumes & volumeMounts section bellow, please comment out those above. + # volumes: + # - name: custom-tools + # emptyDir: {} + # + # initContainers: + # - name: download-tools + # image: alpine:3.8 + # command: [sh, -c] + # args: + # - wget -qO- https://get.helm.sh/helm-v2.16.1-linux-amd64.tar.gz | tar -xvzf - && + # mv linux-amd64/helm /custom-tools/ + # volumeMounts: + # - mountPath: /custom-tools + # name: custom-tools + # volumeMounts: + # - mountPath: /usr/local/bin/helm + # name: custom-tools + # subPath: helm + ## Argo Configs configs: knownHosts: From 0e2c29c0c3565f6b064431d1b74eee502f639f08 Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Sun, 8 Dec 2019 22:34:52 -0500 Subject: [PATCH 2/2] [argo-cd] Added simple PrometheusRule (#178) * [argo-cd] Added simple PrometheusRule This patch adds a few simple rules which you can leverage to make sure that your infrastructure is up to date. They are optional and opt-in only. * Add conditional selector fix from #180 * Bump chart version --- charts/argo-cd/Chart.yaml | 2 +- .../prometheusrule.yaml | 27 ++++++++++++++++ charts/argo-cd/values.yaml | 31 +++++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 charts/argo-cd/templates/argocd-application-controller/prometheusrule.yaml diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index 4cf918c4..7dd5699c 100644 --- a/charts/argo-cd/Chart.yaml +++ b/charts/argo-cd/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "1.3.0" description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes. name: argo-cd -version: 1.4.2 +version: 1.4.3 home: https://github.com/argoproj/argo-helm icon: https://raw.githubusercontent.com/argoproj/argo/master/argo.png keywords: diff --git a/charts/argo-cd/templates/argocd-application-controller/prometheusrule.yaml b/charts/argo-cd/templates/argocd-application-controller/prometheusrule.yaml new file mode 100644 index 00000000..8d104f40 --- /dev/null +++ b/charts/argo-cd/templates/argocd-application-controller/prometheusrule.yaml @@ -0,0 +1,27 @@ +{{- if and .Values.controller.metrics.enabled .Values.controller.metrics.rules.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: + name: {{ template "argo-cd.controller.fullname" . }} + {{- if .Values.controller.metrics.rules.namespace }} + namespace: {{ .Values.controller.metrics.rules.namespace }} + {{- end }} + labels: + app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.controller.name }} + 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.controller.name }} + {{- if .Values.controller.metrics.rules.selector }} +{{- toYaml .Values.controller.metrics.rules.selector | nindent 4 }} + {{- end }} + {{- if .Values.controller.metrics.rules.additionalLabels }} +{{- toYaml .Values.controller.metrics.rules.additionalLabels | nindent 4 }} + {{- end }} +spec: + groups: + - name: argocd + rules: +{{- toYaml .Values.controller.metrics.rules.spec | nindent 4 }} +{{- end }} diff --git a/charts/argo-cd/values.yaml b/charts/argo-cd/values.yaml index 0b7f2ae7..e022b1d3 100644 --- a/charts/argo-cd/values.yaml +++ b/charts/argo-cd/values.yaml @@ -111,6 +111,37 @@ controller: # prometheus: kube-prometheus # namespace: monitoring # additionalLabels: {} + rules: + enabled: false + spec: [] + # - alert: ArgoAppMissing + # expr: | + # absent(argocd_app_info) + # for: 15m + # labels: + # severity: critical + # annotations: + # summary: "[ArgoCD] No reported applications" + # description: > + # ArgoCD has not reported any applications data for the past 15 minutes which + # means that it must be down or not functioning properly. This needs to be + # resolved for this cloud to continue to maintain state. + # - alert: ArgoAppNotSynced + # expr: | + # argocd_app_sync_status{sync_status!="Synced"} == 1 + # for: 12h + # labels: + # severity: warning + # annotations: + # summary: "[{{`{{$labels.name}}`}}] Application not synchronized" + # description: > + # The application [{{`{{$labels.name}}`}} has not been synchronized for over + # 12 hours which means that the state of this cloud has drifted away from the + # state inside Git. + # selector: + # prometheus: kube-prometheus + # namespace: monitoring + # additionalLabels: {} ## Enable Admin ClusterRole resources. ## Enable if you would like to grant rights to ArgoCD to deploy to the local kuberentes cluster.