refactor(argo-cd): Use templating for labels (#627)
Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
This commit is contained in:
parent
da2dbda83e
commit
3b0ebdda66
49 changed files with 92 additions and 347 deletions
|
|
@ -4,12 +4,7 @@ kind: ClusterRole
|
|||
metadata:
|
||||
name: {{ template "argo-cd.controller.fullname" . }}
|
||||
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 }}
|
||||
{{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
|
||||
rules:
|
||||
- apiGroups:
|
||||
- '*'
|
||||
|
|
|
|||
|
|
@ -4,12 +4,7 @@ kind: ClusterRoleBinding
|
|||
metadata:
|
||||
name: {{ template "argo-cd.controller.fullname" . }}
|
||||
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 }}
|
||||
{{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
|
|
|
|||
|
|
@ -4,18 +4,12 @@ kind: {{ .Values.controller.enableStatefulSet | ternary "StatefulSet" "Deploymen
|
|||
metadata:
|
||||
name: {{ template "argo-cd.controller.fullname" . }}
|
||||
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 }}
|
||||
{{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
|
||||
app.kubernetes.io/version: {{ default .Values.global.image.tag .Values.controller.image.tag | quote }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.controller.name }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.controller.name) | nindent 6 }}
|
||||
{{- if .Values.controller.enableStatefulSet }}
|
||||
serviceName: {{ template "argo-cd.controller.fullname" . }}
|
||||
{{- end }}
|
||||
|
|
@ -30,12 +24,7 @@ spec:
|
|||
{{- end }}
|
||||
{{- 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 }}
|
||||
{{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 8 }}
|
||||
app.kubernetes.io/version: {{ default .Values.global.image.tag .Values.controller.image.tag | quote }}
|
||||
{{- if .Values.controller.podLabels }}
|
||||
{{- toYaml .Values.controller.podLabels | nindent 8 }}
|
||||
|
|
|
|||
|
|
@ -9,12 +9,7 @@ metadata:
|
|||
{{- end }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "argo-cd.name" . }}-metrics
|
||||
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 }}
|
||||
{{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" "metrics") | nindent 4 }}
|
||||
{{- if .Values.controller.metrics.service.labels }}
|
||||
{{- toYaml .Values.controller.metrics.service.labels | nindent 4 }}
|
||||
{{- end }}
|
||||
|
|
@ -26,6 +21,5 @@ spec:
|
|||
port: {{ .Values.controller.metrics.service.servicePort }}
|
||||
targetPort: controller
|
||||
selector:
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.controller.name }}
|
||||
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.controller.name) | nindent 4 }}
|
||||
{{- end }}
|
||||
|
|
@ -7,12 +7,7 @@ metadata:
|
|||
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 }}
|
||||
{{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
|
||||
{{- if .Values.controller.metrics.rules.selector }}
|
||||
{{- toYaml .Values.controller.metrics.rules.selector | nindent 4 }}
|
||||
{{- end }}
|
||||
|
|
|
|||
|
|
@ -3,12 +3,7 @@ kind: Role
|
|||
metadata:
|
||||
name: {{ template "argo-cd.controller.fullname" . }}
|
||||
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 }}
|
||||
{{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
|
|
|
|||
|
|
@ -3,12 +3,7 @@ kind: RoleBinding
|
|||
metadata:
|
||||
name: {{ template "argo-cd.controller.fullname" . }}
|
||||
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 }}
|
||||
{{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
|
|
|
|||
|
|
@ -9,17 +9,11 @@ metadata:
|
|||
{{- end }}
|
||||
name: {{ template "argo-cd.controller.fullname" . }}
|
||||
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 }}
|
||||
{{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
|
||||
spec:
|
||||
ports:
|
||||
- name: {{ .Values.controller.service.portName }}
|
||||
port: {{ .Values.controller.service.port }}
|
||||
targetPort: {{ .Values.controller.containerPort }}
|
||||
selector:
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.controller.name }}
|
||||
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.controller.name) | nindent 4 }}
|
||||
|
|
@ -11,10 +11,5 @@ metadata:
|
|||
{{- end }}
|
||||
{{- 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 }}
|
||||
{{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
|
||||
{{- end }}
|
||||
|
|
|
|||
|
|
@ -7,12 +7,7 @@ metadata:
|
|||
namespace: {{ .Values.controller.metrics.serviceMonitor.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 }}
|
||||
{{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
|
||||
{{- if .Values.controller.metrics.serviceMonitor.selector }}
|
||||
{{- toYaml .Values.controller.metrics.serviceMonitor.selector | nindent 4 }}
|
||||
{{- end }}
|
||||
|
|
@ -29,7 +24,6 @@ spec:
|
|||
- {{ .Release.Namespace }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: {{ include "argo-cd.name" . }}-metrics
|
||||
app.kubernetes.io/component: {{ .Values.controller.name }}
|
||||
{{- include "argo-cd.selectorLabels" (dict "context" . "component" .Values.controller.name "name" "metrics") | nindent 6 }}
|
||||
{{- end }}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue