diff --git a/charts/prometheus-cloudwatch-exporter/Chart.yaml b/charts/prometheus-cloudwatch-exporter/Chart.yaml index 93f232c499af..d30ba9194de4 100644 --- a/charts/prometheus-cloudwatch-exporter/Chart.yaml +++ b/charts/prometheus-cloudwatch-exporter/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v1 -appVersion: "0.16.0" +appVersion: "0.17.0" description: A Helm chart for prometheus cloudwatch-exporter name: prometheus-cloudwatch-exporter version: 0.28.1 diff --git a/charts/prometheus-cloudwatch-exporter/templates/clusterrole.yaml b/charts/prometheus-cloudwatch-exporter/templates/clusterrole.yaml index 9afa3037a4e2..7d4067ac87a3 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/clusterrole.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/clusterrole.yaml @@ -8,6 +8,9 @@ metadata: chart: {{ template "prometheus-cloudwatch-exporter.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- if .Values.commonLabels }} + {{- toYaml .Values.commonLabels | nindent 4 -}} + {{- end }} rules: - apiGroups: [""] resources: ["secrets","configmap"] diff --git a/charts/prometheus-cloudwatch-exporter/templates/clusterrolebinding.yaml b/charts/prometheus-cloudwatch-exporter/templates/clusterrolebinding.yaml index d9708e7ab6f3..a0a5084bbf9f 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/clusterrolebinding.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/clusterrolebinding.yaml @@ -8,6 +8,9 @@ metadata: chart: {{ template "prometheus-cloudwatch-exporter.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- if .Values.commonLabels }} + {{- toYaml .Values.commonLabels | nindent 4 -}} + {{- end }} subjects: - kind: ServiceAccount name: {{ template "prometheus-cloudwatch-exporter.serviceAccountName" . }} diff --git a/charts/prometheus-cloudwatch-exporter/templates/configmap.yaml b/charts/prometheus-cloudwatch-exporter/templates/configmap.yaml index fa2699df3de6..eb01a53a6346 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/configmap.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/configmap.yaml @@ -8,6 +8,9 @@ metadata: chart: {{ template "prometheus-cloudwatch-exporter.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- if .Values.commonLabels }} + {{- toYaml .Values.commonLabels | nindent 4 -}} + {{- end }} data: config.yml: | {{ tpl .Values.config . | nindent 4 }} diff --git a/charts/prometheus-cloudwatch-exporter/templates/deployment.yaml b/charts/prometheus-cloudwatch-exporter/templates/deployment.yaml index 35544066f49a..043f808117cb 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/deployment.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/deployment.yaml @@ -8,6 +8,9 @@ metadata: chart: {{ template "prometheus-cloudwatch-exporter.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- if .Values.commonLabels }} + {{- toYaml .Values.commonLabels | nindent 4 -}} + {{- end }} {{- with .Values.deployment.labels }} {{- toYaml . | nindent 4 }} {{- end }} @@ -26,6 +29,9 @@ spec: labels: app: {{ template "prometheus-cloudwatch-exporter.name" . }} release: {{ .Release.Name }} + {{- if .Values.commonLabels }} + {{- toYaml .Values.commonLabels | nindent 8 -}} + {{- end }} {{- if .Values.pod.labels }} {{ toYaml .Values.pod.labels | indent 8 }} {{- end }} diff --git a/charts/prometheus-cloudwatch-exporter/templates/ingress.yaml b/charts/prometheus-cloudwatch-exporter/templates/ingress.yaml index c58cf427e465..d441c0295f90 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/ingress.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/ingress.yaml @@ -13,6 +13,9 @@ metadata: chart: {{ template "prometheus-cloudwatch-exporter.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- if .Values.commonLabels }} + {{- toYaml .Values.commonLabels | nindent 4 -}} + {{- end }} {{- if .Values.ingress.labels }} {{ toYaml .Values.ingress.labels | indent 4 }} {{- end }} diff --git a/charts/prometheus-cloudwatch-exporter/templates/pdb.yaml b/charts/prometheus-cloudwatch-exporter/templates/pdb.yaml index 7a88ca5c6ed1..1591fd685101 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/pdb.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/pdb.yaml @@ -9,6 +9,9 @@ metadata: chart: {{ template "prometheus-cloudwatch-exporter.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- if .Values.commonLabels }} + {{- toYaml .Values.commonLabels | nindent 4 -}} + {{- end }} spec: {{- if .Values.podDisruptionBudget.minAvailable }} minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} diff --git a/charts/prometheus-cloudwatch-exporter/templates/prometheusrule.yaml b/charts/prometheus-cloudwatch-exporter/templates/prometheusrule.yaml index e0c0b8e44ce9..b6cad6e3e61d 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/prometheusrule.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/prometheusrule.yaml @@ -3,10 +3,13 @@ apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule metadata: -{{- if .Values.prometheusRule.labels }} labels: -{{ toYaml .Values.prometheusRule.labels | indent 4}} -{{- end }} + {{- if .Values.prometheusRule.labels }} + {{ toYaml .Values.prometheusRule.labels | nindent 4 }} + {{- end }} + {{- if .Values.commonLabels }} + {{- toYaml .Values.commonLabels | nindent 4 -}} + {{- end }} name: {{ $fullName }} {{- if .Values.prometheusRule.namespace }} namespace: {{ .Values.prometheusRule.namespace }} diff --git a/charts/prometheus-cloudwatch-exporter/templates/secrets.yaml b/charts/prometheus-cloudwatch-exporter/templates/secrets.yaml index 7309b4d4fbe6..0548c1c770c1 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/secrets.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/secrets.yaml @@ -9,6 +9,9 @@ metadata: chart: {{ template "prometheus-cloudwatch-exporter.chart" . }} heritage: {{ .Release.Service }} release: {{ .Release.Name }} + {{- if .Values.commonLabels }} + {{- toYaml .Values.commonLabels | nindent 4 -}} + {{- end }} type: Opaque data: {{ if .Values.aws.aws_access_key_id }} diff --git a/charts/prometheus-cloudwatch-exporter/templates/service.yaml b/charts/prometheus-cloudwatch-exporter/templates/service.yaml index 6fb1b125475d..a67445423ecb 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/service.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/service.yaml @@ -10,6 +10,9 @@ metadata: chart: {{ template "prometheus-cloudwatch-exporter.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- if .Values.commonLabels }} + {{- toYaml .Values.commonLabels | nindent 4 -}} + {{- end }} {{- if .Values.service.labels }} {{ toYaml .Values.service.labels | indent 4 }} {{- end }} diff --git a/charts/prometheus-cloudwatch-exporter/templates/serviceaccount.yaml b/charts/prometheus-cloudwatch-exporter/templates/serviceaccount.yaml index 7eb7cf75ed7e..002c7fb32a09 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/serviceaccount.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/serviceaccount.yaml @@ -10,6 +10,9 @@ metadata: chart: {{ template "prometheus-cloudwatch-exporter.chart" . }} release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" + {{- if .Values.commonLabels }} + {{- toYaml .Values.commonLabels | nindent 4 -}} + {{- end }} {{- if .Values.serviceAccount.annotations }} annotations: {{ toYaml .Values.serviceAccount.annotations | nindent 4 }} diff --git a/charts/prometheus-cloudwatch-exporter/templates/servicemonitor.yaml b/charts/prometheus-cloudwatch-exporter/templates/servicemonitor.yaml index ed9234f34fa0..eb22604c7c27 100644 --- a/charts/prometheus-cloudwatch-exporter/templates/servicemonitor.yaml +++ b/charts/prometheus-cloudwatch-exporter/templates/servicemonitor.yaml @@ -2,10 +2,13 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: -{{- if .Values.serviceMonitor.labels }} labels: -{{ toYaml .Values.serviceMonitor.labels | indent 4}} -{{- end }} + {{- if .Values.serviceMonitor.labels }} + {{ toYaml .Values.serviceMonitor.labels | nindent 4}} + {{- end }} + {{- if .Values.commonLabels }} + {{- toYaml .Values.commonLabels | nindent 4 -}} + {{- end }} name: {{ template "prometheus-cloudwatch-exporter.fullname" . }} {{- if .Values.serviceMonitor.namespace }} namespace: {{ .Values.serviceMonitor.namespace }} diff --git a/charts/prometheus-cloudwatch-exporter/values.yaml b/charts/prometheus-cloudwatch-exporter/values.yaml index 2353ea73568a..9672f6f49dc8 100644 --- a/charts/prometheus-cloudwatch-exporter/values.yaml +++ b/charts/prometheus-cloudwatch-exporter/values.yaml @@ -2,6 +2,9 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. +# Adding labels to all K8S resources +commonLabels: {} + replicaCount: 1 image: