Skip to content

Commit

Permalink
add servicemonitor labels
Browse files Browse the repository at this point in the history
  • Loading branch information
nickkounz committed Nov 21, 2022
1 parent a3eff38 commit 6e12f99
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/graphprotocol-node/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: graphprotocol-node
description: A Helm chart for Graph Protocol Nodes
type: application
version: 0.1.11
version: 0.1.12
keywords:
- graphprotocol
- ethereum
Expand Down
13 changes: 13 additions & 0 deletions charts/graphprotocol-node/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,16 @@ Selector labels
app.kubernetes.io/name: {{ include "graphprotocol-node.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
ServiceMonitor labels
*/}}
{{- define "graphprotocol-node.serviceMonitorLabels" -}}
service.monitor: {{ .Values.monitoring.labels }}
helm.sh/chart: {{ include "graphprotocol-node.chart" . }}
{{ include "graphprotocol-node.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/graphprotocol-node/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: ServiceMonitor
metadata:
name: {{ include "graphprotocol-node.fullname" . }}
labels:
{{- include "graphprotocol-node.labels" . | nindent 4 }}
{{- include "graphprotocol-node.serviceMonitorLabels" . | nindent 4 }}
spec:
selector:
matchLabels:
Expand Down
7 changes: 6 additions & 1 deletion charts/graphprotocol-node/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,16 @@
"monitoring": {
"type": "object",
"required": [
"enabled"
"enabled",
"labels"
],
"enabled": {
"type": "boolean",
"description": "enabled ServiceMonitor object creation"
},
"labels": {
"type": "string",
"description": "specify the service.monitor label value."
}
}
},
Expand Down
1 change: 1 addition & 0 deletions charts/graphprotocol-node/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ role: "query-node"

monitoring:
enabled: false
labels: "prometheus"

ingress:
enabled: false
Expand Down

0 comments on commit 6e12f99

Please sign in to comment.