Skip to content

Commit

Permalink
added podmonitor for metrics scraping
Browse files Browse the repository at this point in the history
  • Loading branch information
first-sportsbook committed Dec 19, 2022
1 parent 908210e commit 026c1ba
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
11 changes: 9 additions & 2 deletions chart/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ spec:
template:
metadata:
labels:
app: {{ include "chart.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
release: {{ .Release.Name }}
app.kubernetes.io/name: {{ include "chart.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
Expand All @@ -25,8 +28,12 @@ spec:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: 8080
protocol: TCP
- containerPort: 8080
protocol: TCP
name: metrics
- containerPort: 80
protocol: TCP
name: web
env:
- name: NODE_NAME
valueFrom:
Expand Down
19 changes: 19 additions & 0 deletions chart/templates/pormonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: kube-prometheus-stack-multicooker-metrics
namespace: monitoring
labels:
#some of those labels should match the "spec.selector.matchLatels" of prometheus otherwise metrics won't be available in targets
app: kube-prometheus-stack-operator
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
release: kube-prometheus-stack
{{- range $key, $value := .Values.serviceMonitor.additionalLabels }}
{{ $key }}: {{ $value | quote }}
spec:
selector:
matchLabels:
app: {{ include "chart.name" . }}
podMetricsEndpoints:
- port: metrics
- path: "/metrics"
2 changes: 1 addition & 1 deletion chart/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
image:
repository: docmarr/kubernetes-multicooker
tag: "1.0.0"
tag: "1.0.2"
pullPolicy: Always

nameOverride: ""
Expand Down

0 comments on commit 026c1ba

Please sign in to comment.