Skip to content

Commit

Permalink
Fix difference between selector labels in serviceMonitor and service (#…
Browse files Browse the repository at this point in the history
…108)

* FIX selector

* FIX selector labels

Added labels that exists in service, but doesn't exist in service monitor

* Added missed label helm.sh/from

* Update service.yaml

* Update service.yaml

* Update servicemonitor.yaml
  • Loading branch information
notariuss committed May 28, 2020
1 parent 9c42b77 commit e4b9009
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion chart/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ metadata:
helm.sh/chart: {{ include "app.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{ with .Values.service.labels }}{{ toYaml . | indent 4 }}{{ end }}
helm.sh/from: deploy.{{ include "app.fullname" . }}
{{- with .Values.service.labels }}{{ toYaml . | nindent 4 }}{{ end }}
{{- with .Values.service.annotations }}
annotations: {{ toYaml . | nindent 4 }}
{{- end }}
Expand Down
4 changes: 4 additions & 0 deletions chart/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ spec:
selector:
matchLabels:
app.kubernetes.io/name: {{ include "app.name" . }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
helm.sh/chart: {{ include "app.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/from: deploy.{{ include "app.fullname" . }}
{{- with .Values.service.labels }}{{ toYaml . | nindent 6 }}{{ end }}
endpoints:
- port: metrics
interval: {{ .Values.serviceMonitor.scrapeInterval }}
Expand Down

0 comments on commit e4b9009

Please sign in to comment.