chore(argo-cd): Metrics DRY cleaning (#1569)

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>
This commit is contained in:
Petr Drastil 2022-10-25 16:08:51 +02:00 committed by GitHub
parent e217e71580
commit 24de82b214
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 47 additions and 48 deletions

View file

@ -2,7 +2,7 @@ apiVersion: v2
appVersion: v2.4.15
description: A Helm chart for Argo CD, a declarative, GitOps continuous delivery tool for Kubernetes.
name: argo-cd
version: 5.6.7
version: 5.6.8
home: https://github.com/argoproj/argo-helm
icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png
sources:
@ -22,5 +22,4 @@ dependencies:
condition: redis-ha.enabled
annotations:
artifacthub.io/changes: |
- "[Changed]: Created dedicated docs section for Argo CD configs"
- "[Fixed]: Documentation how to run server as insecure"
- "[Changed]: DRY cleanup of metrics templates"

View file

@ -2,18 +2,18 @@
apiVersion: v1
kind: Service
metadata:
{{- if .Values.applicationSet.metrics.service.annotations }}
name: {{ include "argo-cd.applicationSet.fullname" . }}-metrics
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.applicationSet.name "name" "metrics") | nindent 4 }}
{{- with .Values.applicationSet.metrics.service.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.applicationSet.metrics.service.annotations }}
annotations:
{{- range $key, $value := .Values.applicationSet.metrics.service.annotations }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.applicationSet.name "name" "metrics") | nindent 4 }}
{{- if .Values.applicationSet.metrics.service.labels }}
{{- toYaml .Values.applicationSet.metrics.service.labels | nindent 4 }}
{{- end }}
name: {{ template "argo-cd.applicationSet.fullname" . }}-metrics
spec:
ports:
- name: {{ .Values.applicationSet.metrics.service.portName }}

View file

@ -2,18 +2,18 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "argo-cd.notifications.fullname" . }}-metrics
name: {{ include "argo-cd.notifications.fullname" . }}-metrics
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.notifications.name "name" "metrics") | nindent 4 }}
{{- if .Values.notifications.metrics.service.labels }}
{{- toYaml .Values.notifications.metrics.service.labels | nindent 4 }}
{{- end }}
{{- if .Values.notifications.metrics.service.annotations }}
{{- with .Values.notifications.metrics.service.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.notifications.metrics.service.annotations }}
annotations:
{{- range $key, $value := .Values.notifications.metrics.service.annotations }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end }}
spec:
selector:
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.notifications.name) | nindent 6 }}

View file

@ -1,19 +1,19 @@
{{- if .Values.repoServer.metrics.enabled}}
{{- if .Values.repoServer.metrics.enabled }}
apiVersion: v1
kind: Service
metadata:
{{- if .Values.repoServer.metrics.service.annotations }}
annotations:
{{- range $key, $value := .Values.repoServer.metrics.service.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
name: {{ include "argo-cd.repoServer.fullname" . }}-metrics
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.repoServer.name "name" (printf "%s-metrics" .Values.repoServer.name)) | nindent 4 }}
{{- if .Values.repoServer.metrics.service.labels }}
{{- toYaml .Values.repoServer.metrics.service.labels | nindent 4 }}
{{- end }}
name: {{ template "argo-cd.repoServer.fullname" . }}-metrics
{{- with .Values.repoServer.metrics.service.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.repoServer.metrics.service.annotations }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
ports:
- name: {{ .Values.repoServer.metrics.service.portName }}
@ -22,4 +22,4 @@ spec:
targetPort: metrics
selector:
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.repoServer.name) | nindent 4 }}
{{- end }}
{{- end }}

View file

@ -2,18 +2,18 @@
apiVersion: v1
kind: Service
metadata:
{{- if .Values.server.metrics.service.annotations }}
annotations:
{{- range $key, $value := .Values.server.metrics.service.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
name: {{ include "argo-cd.server.fullname" . }}-metrics
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" (printf "%s-metrics" .Values.server.name)) | nindent 4 }}
{{- if .Values.server.metrics.service.labels }}
{{- toYaml .Values.server.metrics.service.labels | nindent 4 }}
{{- end }}
name: {{ template "argo-cd.server.fullname" . }}-metrics
{{- with .Values.server.metrics.service.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.server.metrics.service.annotations }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
ports:
- name: {{ .Values.server.metrics.service.portName }}
@ -22,4 +22,4 @@ spec:
targetPort: metrics
selector:
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.server.name) | nindent 4 }}
{{- end }}
{{- end }}

View file

@ -3,19 +3,20 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "argo-cd.redis.fullname" . }}-metrics
name: {{ include "argo-cd.redis.fullname" . }}-metrics
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.redis.name "name" .Values.redis.name) | nindent 4 }}
{{- with .Values.redis.metrics.service.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.redis.metrics.service.annotations }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.redis.name "name" .Values.redis.name) | nindent 4 }}
{{- with .Values.redis.metrics.service.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.redis.metrics.service.type }}
{{- with .Values.redis.metrics.service.clusterIP }}
clusterIP: {{ . }}
{{- end }}
@ -26,5 +27,4 @@ spec:
targetPort: metrics
selector:
{{- include "argo-cd.selectorLabels" (dict "context" . "component" .Values.redis.name "name" .Values.redis.name) | nindent 4 }}
type: {{ .Values.redis.metrics.service.type }}
{{- end }}